From d33ef96baf81e0988e6baa21e9ae50546c8810e1 Mon Sep 17 00:00:00 2001 From: Joshua Humphries Date: Mon, 30 Apr 2018 23:32:06 -0400 Subject: [PATCH] fix compile errors caused by protobuf merging their dev branch to master (#636) --- .../proto/examplepb/a_bit_of_everything.pb.go | 291 ++++++---- examples/proto/examplepb/echo_service.pb.go | 109 ++-- .../proto/examplepb/flow_combination.pb.go | 178 +++++- examples/proto/examplepb/stream.pb.go | 54 +- .../examplepb/unannotated_echo_service.pb.go | 60 +- examples/proto/examplepb/wrappers.pb.go | 68 ++- examples/proto/sub/message.pb.go | 48 +- examples/proto/sub2/message.pb.go | 49 +- protoc-gen-swagger/options/annotations.pb.go | 24 +- protoc-gen-swagger/options/openapiv2.pb.go | 532 +++++++++++++----- runtime/internal/stream_chunk.pb.go | 59 +- runtime/marshal_proto_test.go | 8 +- runtime/query_test.go | 38 +- 13 files changed, 1082 insertions(+), 436 deletions(-) diff --git a/examples/proto/examplepb/a_bit_of_everything.pb.go b/examples/proto/examplepb/a_bit_of_everything.pb.go index 23703e51d83..64a70461dfd 100644 --- a/examples/proto/examplepb/a_bit_of_everything.pb.go +++ b/examples/proto/examplepb/a_bit_of_everything.pb.go @@ -6,13 +6,13 @@ package examplepb import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import _ "google.golang.org/genproto/googleapis/api/annotations" -import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" -import google_protobuf2 "github.com/golang/protobuf/ptypes/duration" -import grpc_gateway_examples_sub "github.com/grpc-ecosystem/grpc-gateway/examples/proto/sub" +import duration "github.com/golang/protobuf/ptypes/duration" +import empty "github.com/golang/protobuf/ptypes/empty" +import timestamp "github.com/golang/protobuf/ptypes/timestamp" +import sub "github.com/grpc-ecosystem/grpc-gateway/examples/proto/sub" import sub2 "github.com/grpc-ecosystem/grpc-gateway/examples/proto/sub2" -import google_protobuf3 "github.com/golang/protobuf/ptypes/timestamp" import _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" +import _ "google.golang.org/genproto/googleapis/api/annotations" import ( context "golang.org/x/net/context" @@ -24,6 +24,12 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + // NumericEnum is one or zero. type NumericEnum int32 @@ -46,7 +52,9 @@ var NumericEnum_value = map[string]int32{ func (x NumericEnum) String() string { return proto.EnumName(NumericEnum_name, int32(x)) } -func (NumericEnum) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } +func (NumericEnum) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_a_bit_of_everything_f27080d9602a5f10, []int{0} +} // DeepEnum is one or zero. type ABitOfEverything_Nested_DeepEnum int32 @@ -71,7 +79,7 @@ func (x ABitOfEverything_Nested_DeepEnum) String() string { return proto.EnumName(ABitOfEverything_Nested_DeepEnum_name, int32(x)) } func (ABitOfEverything_Nested_DeepEnum) EnumDescriptor() ([]byte, []int) { - return fileDescriptor1, []int{0, 0, 0} + return fileDescriptor_a_bit_of_everything_f27080d9602a5f10, []int{0, 0, 0} } // Intentionaly complicated message type to cover much features of Protobuf. @@ -105,22 +113,44 @@ type ABitOfEverything struct { MappedStringValue map[string]string `protobuf:"bytes,23,rep,name=mapped_string_value,json=mappedStringValue" json:"mapped_string_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` MappedNestedValue map[string]*ABitOfEverything_Nested `protobuf:"bytes,24,rep,name=mapped_nested_value,json=mappedNestedValue" json:"mapped_nested_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` NonConventionalNameValue string `protobuf:"bytes,26,opt,name=nonConventionalNameValue" json:"nonConventionalNameValue,omitempty"` - TimestampValue *google_protobuf3.Timestamp `protobuf:"bytes,27,opt,name=timestamp_value,json=timestampValue" json:"timestamp_value,omitempty"` + TimestampValue *timestamp.Timestamp `protobuf:"bytes,27,opt,name=timestamp_value,json=timestampValue" json:"timestamp_value,omitempty"` // repeated enum value. it is comma-separated in query - RepeatedEnumValue []NumericEnum `protobuf:"varint,28,rep,packed,name=repeated_enum_value,json=repeatedEnumValue,enum=grpc.gateway.examples.examplepb.NumericEnum" json:"repeated_enum_value,omitempty"` + RepeatedEnumValue []NumericEnum `protobuf:"varint,28,rep,packed,name=repeated_enum_value,json=repeatedEnumValue,enum=grpc.gateway.examples.examplepb.NumericEnum" json:"repeated_enum_value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ABitOfEverything) Reset() { *m = ABitOfEverything{} } +func (m *ABitOfEverything) String() string { return proto.CompactTextString(m) } +func (*ABitOfEverything) ProtoMessage() {} +func (*ABitOfEverything) Descriptor() ([]byte, []int) { + return fileDescriptor_a_bit_of_everything_f27080d9602a5f10, []int{0} +} +func (m *ABitOfEverything) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ABitOfEverything.Unmarshal(m, b) +} +func (m *ABitOfEverything) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ABitOfEverything.Marshal(b, m, deterministic) +} +func (dst *ABitOfEverything) XXX_Merge(src proto.Message) { + xxx_messageInfo_ABitOfEverything.Merge(dst, src) +} +func (m *ABitOfEverything) XXX_Size() int { + return xxx_messageInfo_ABitOfEverything.Size(m) +} +func (m *ABitOfEverything) XXX_DiscardUnknown() { + xxx_messageInfo_ABitOfEverything.DiscardUnknown(m) } -func (m *ABitOfEverything) Reset() { *m = ABitOfEverything{} } -func (m *ABitOfEverything) String() string { return proto.CompactTextString(m) } -func (*ABitOfEverything) ProtoMessage() {} -func (*ABitOfEverything) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } +var xxx_messageInfo_ABitOfEverything proto.InternalMessageInfo type isABitOfEverything_OneofValue interface { isABitOfEverything_OneofValue() } type ABitOfEverything_OneofEmpty struct { - OneofEmpty *google_protobuf1.Empty `protobuf:"bytes,20,opt,name=oneof_empty,json=oneofEmpty,oneof"` + OneofEmpty *empty.Empty `protobuf:"bytes,20,opt,name=oneof_empty,json=oneofEmpty,oneof"` } type ABitOfEverything_OneofString struct { OneofString string `protobuf:"bytes,21,opt,name=oneof_string,json=oneofString,oneof"` @@ -276,7 +306,7 @@ func (m *ABitOfEverything) GetRepeatedStringValue() []string { return nil } -func (m *ABitOfEverything) GetOneofEmpty() *google_protobuf1.Empty { +func (m *ABitOfEverything) GetOneofEmpty() *empty.Empty { if x, ok := m.GetOneofValue().(*ABitOfEverything_OneofEmpty); ok { return x.OneofEmpty } @@ -318,7 +348,7 @@ func (m *ABitOfEverything) GetNonConventionalNameValue() string { return "" } -func (m *ABitOfEverything) GetTimestampValue() *google_protobuf3.Timestamp { +func (m *ABitOfEverything) GetTimestampValue() *timestamp.Timestamp { if m != nil { return m.TimestampValue } @@ -366,7 +396,7 @@ func _ABitOfEverything_OneofUnmarshaler(msg proto.Message, tag, wire int, b *pro if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } - msg := new(google_protobuf1.Empty) + msg := new(empty.Empty) err := b.DecodeMessage(msg) m.OneofValue = &ABitOfEverything_OneofEmpty{msg} return true, err @@ -388,11 +418,11 @@ func _ABitOfEverything_OneofSizer(msg proto.Message) (n int) { switch x := m.OneofValue.(type) { case *ABitOfEverything_OneofEmpty: s := proto.Size(x.OneofEmpty) - n += proto.SizeVarint(20<<3 | proto.WireBytes) + n += 2 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *ABitOfEverything_OneofString: - n += proto.SizeVarint(21<<3 | proto.WireBytes) + n += 2 // tag and wire n += proto.SizeVarint(uint64(len(x.OneofString))) n += len(x.OneofString) case nil: @@ -405,15 +435,37 @@ func _ABitOfEverything_OneofSizer(msg proto.Message) (n int) { // Nested is nested type. type ABitOfEverything_Nested struct { // name is nested field. - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Amount uint32 `protobuf:"varint,2,opt,name=amount" json:"amount,omitempty"` - Ok ABitOfEverything_Nested_DeepEnum `protobuf:"varint,3,opt,name=ok,enum=grpc.gateway.examples.examplepb.ABitOfEverything_Nested_DeepEnum" json:"ok,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Amount uint32 `protobuf:"varint,2,opt,name=amount" json:"amount,omitempty"` + Ok ABitOfEverything_Nested_DeepEnum `protobuf:"varint,3,opt,name=ok,enum=grpc.gateway.examples.examplepb.ABitOfEverything_Nested_DeepEnum" json:"ok,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ABitOfEverything_Nested) Reset() { *m = ABitOfEverything_Nested{} } -func (m *ABitOfEverything_Nested) String() string { return proto.CompactTextString(m) } -func (*ABitOfEverything_Nested) ProtoMessage() {} -func (*ABitOfEverything_Nested) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} } +func (m *ABitOfEverything_Nested) Reset() { *m = ABitOfEverything_Nested{} } +func (m *ABitOfEverything_Nested) String() string { return proto.CompactTextString(m) } +func (*ABitOfEverything_Nested) ProtoMessage() {} +func (*ABitOfEverything_Nested) Descriptor() ([]byte, []int) { + return fileDescriptor_a_bit_of_everything_f27080d9602a5f10, []int{0, 0} +} +func (m *ABitOfEverything_Nested) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ABitOfEverything_Nested.Unmarshal(m, b) +} +func (m *ABitOfEverything_Nested) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ABitOfEverything_Nested.Marshal(b, m, deterministic) +} +func (dst *ABitOfEverything_Nested) XXX_Merge(src proto.Message) { + xxx_messageInfo_ABitOfEverything_Nested.Merge(dst, src) +} +func (m *ABitOfEverything_Nested) XXX_Size() int { + return xxx_messageInfo_ABitOfEverything_Nested.Size(m) +} +func (m *ABitOfEverything_Nested) XXX_DiscardUnknown() { + xxx_messageInfo_ABitOfEverything_Nested.DiscardUnknown(m) +} + +var xxx_messageInfo_ABitOfEverything_Nested proto.InternalMessageInfo func (m *ABitOfEverything_Nested) GetName() string { if m != nil { @@ -437,13 +489,35 @@ func (m *ABitOfEverything_Nested) GetOk() ABitOfEverything_Nested_DeepEnum { } type Body struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Body) Reset() { *m = Body{} } -func (m *Body) String() string { return proto.CompactTextString(m) } -func (*Body) ProtoMessage() {} -func (*Body) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } +func (m *Body) Reset() { *m = Body{} } +func (m *Body) String() string { return proto.CompactTextString(m) } +func (*Body) ProtoMessage() {} +func (*Body) Descriptor() ([]byte, []int) { + return fileDescriptor_a_bit_of_everything_f27080d9602a5f10, []int{1} +} +func (m *Body) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Body.Unmarshal(m, b) +} +func (m *Body) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Body.Marshal(b, m, deterministic) +} +func (dst *Body) XXX_Merge(src proto.Message) { + xxx_messageInfo_Body.Merge(dst, src) +} +func (m *Body) XXX_Size() int { + return xxx_messageInfo_Body.Size(m) +} +func (m *Body) XXX_DiscardUnknown() { + xxx_messageInfo_Body.DiscardUnknown(m) +} + +var xxx_messageInfo_Body proto.InternalMessageInfo func (m *Body) GetName() string { if m != nil { @@ -453,14 +527,36 @@ func (m *Body) GetName() string { } type MessageWithBody struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Data *Body `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Data *Body `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *MessageWithBody) Reset() { *m = MessageWithBody{} } -func (m *MessageWithBody) String() string { return proto.CompactTextString(m) } -func (*MessageWithBody) ProtoMessage() {} -func (*MessageWithBody) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } +func (m *MessageWithBody) Reset() { *m = MessageWithBody{} } +func (m *MessageWithBody) String() string { return proto.CompactTextString(m) } +func (*MessageWithBody) ProtoMessage() {} +func (*MessageWithBody) Descriptor() ([]byte, []int) { + return fileDescriptor_a_bit_of_everything_f27080d9602a5f10, []int{2} +} +func (m *MessageWithBody) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithBody.Unmarshal(m, b) +} +func (m *MessageWithBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithBody.Marshal(b, m, deterministic) +} +func (dst *MessageWithBody) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithBody.Merge(dst, src) +} +func (m *MessageWithBody) XXX_Size() int { + return xxx_messageInfo_MessageWithBody.Size(m) +} +func (m *MessageWithBody) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithBody.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithBody proto.InternalMessageInfo func (m *MessageWithBody) GetId() string { if m != nil { @@ -478,6 +574,9 @@ func (m *MessageWithBody) GetData() *Body { func init() { proto.RegisterType((*ABitOfEverything)(nil), "grpc.gateway.examples.examplepb.ABitOfEverything") + proto.RegisterMapType((map[string]NumericEnum)(nil), "grpc.gateway.examples.examplepb.ABitOfEverything.MapValueEntry") + proto.RegisterMapType((map[string]*ABitOfEverything_Nested)(nil), "grpc.gateway.examples.examplepb.ABitOfEverything.MappedNestedValueEntry") + proto.RegisterMapType((map[string]string)(nil), "grpc.gateway.examples.examplepb.ABitOfEverything.MappedStringValueEntry") proto.RegisterType((*ABitOfEverything_Nested)(nil), "grpc.gateway.examples.examplepb.ABitOfEverything.Nested") proto.RegisterType((*Body)(nil), "grpc.gateway.examples.examplepb.Body") proto.RegisterType((*MessageWithBody)(nil), "grpc.gateway.examples.examplepb.MessageWithBody") @@ -499,9 +598,9 @@ type ABitOfEverythingServiceClient interface { Create(ctx context.Context, in *ABitOfEverything, opts ...grpc.CallOption) (*ABitOfEverything, error) CreateBody(ctx context.Context, in *ABitOfEverything, opts ...grpc.CallOption) (*ABitOfEverything, error) Lookup(ctx context.Context, in *sub2.IdMessage, opts ...grpc.CallOption) (*ABitOfEverything, error) - Update(ctx context.Context, in *ABitOfEverything, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) - Delete(ctx context.Context, in *sub2.IdMessage, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) - GetQuery(ctx context.Context, in *ABitOfEverything, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + Update(ctx context.Context, in *ABitOfEverything, opts ...grpc.CallOption) (*empty.Empty, error) + Delete(ctx context.Context, in *sub2.IdMessage, opts ...grpc.CallOption) (*empty.Empty, error) + GetQuery(ctx context.Context, in *ABitOfEverything, opts ...grpc.CallOption) (*empty.Empty, error) // Echo allows posting a StringMessage value. // // It also exposes multiple bindings. @@ -509,13 +608,13 @@ type ABitOfEverythingServiceClient interface { // This makes it useful when validating that the OpenAPI v2 API // description exposes documentation correctly on all paths // defined as additional_bindings in the proto. - Echo(ctx context.Context, in *grpc_gateway_examples_sub.StringMessage, opts ...grpc.CallOption) (*grpc_gateway_examples_sub.StringMessage, error) + Echo(ctx context.Context, in *sub.StringMessage, opts ...grpc.CallOption) (*sub.StringMessage, error) DeepPathEcho(ctx context.Context, in *ABitOfEverything, opts ...grpc.CallOption) (*ABitOfEverything, error) - NoBindings(ctx context.Context, in *google_protobuf2.Duration, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) - Timeout(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) - ErrorWithDetails(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) - GetMessageWithBody(ctx context.Context, in *MessageWithBody, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) - PostWithEmptyBody(ctx context.Context, in *Body, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + NoBindings(ctx context.Context, in *duration.Duration, opts ...grpc.CallOption) (*empty.Empty, error) + Timeout(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) + ErrorWithDetails(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) + GetMessageWithBody(ctx context.Context, in *MessageWithBody, opts ...grpc.CallOption) (*empty.Empty, error) + PostWithEmptyBody(ctx context.Context, in *Body, opts ...grpc.CallOption) (*empty.Empty, error) } type aBitOfEverythingServiceClient struct { @@ -553,8 +652,8 @@ func (c *aBitOfEverythingServiceClient) Lookup(ctx context.Context, in *sub2.IdM return out, nil } -func (c *aBitOfEverythingServiceClient) Update(ctx context.Context, in *ABitOfEverything, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { - out := new(google_protobuf1.Empty) +func (c *aBitOfEverythingServiceClient) Update(ctx context.Context, in *ABitOfEverything, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) err := grpc.Invoke(ctx, "/grpc.gateway.examples.examplepb.ABitOfEverythingService/Update", in, out, c.cc, opts...) if err != nil { return nil, err @@ -562,8 +661,8 @@ func (c *aBitOfEverythingServiceClient) Update(ctx context.Context, in *ABitOfEv return out, nil } -func (c *aBitOfEverythingServiceClient) Delete(ctx context.Context, in *sub2.IdMessage, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { - out := new(google_protobuf1.Empty) +func (c *aBitOfEverythingServiceClient) Delete(ctx context.Context, in *sub2.IdMessage, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) err := grpc.Invoke(ctx, "/grpc.gateway.examples.examplepb.ABitOfEverythingService/Delete", in, out, c.cc, opts...) if err != nil { return nil, err @@ -571,8 +670,8 @@ func (c *aBitOfEverythingServiceClient) Delete(ctx context.Context, in *sub2.IdM return out, nil } -func (c *aBitOfEverythingServiceClient) GetQuery(ctx context.Context, in *ABitOfEverything, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { - out := new(google_protobuf1.Empty) +func (c *aBitOfEverythingServiceClient) GetQuery(ctx context.Context, in *ABitOfEverything, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) err := grpc.Invoke(ctx, "/grpc.gateway.examples.examplepb.ABitOfEverythingService/GetQuery", in, out, c.cc, opts...) if err != nil { return nil, err @@ -580,8 +679,8 @@ func (c *aBitOfEverythingServiceClient) GetQuery(ctx context.Context, in *ABitOf return out, nil } -func (c *aBitOfEverythingServiceClient) Echo(ctx context.Context, in *grpc_gateway_examples_sub.StringMessage, opts ...grpc.CallOption) (*grpc_gateway_examples_sub.StringMessage, error) { - out := new(grpc_gateway_examples_sub.StringMessage) +func (c *aBitOfEverythingServiceClient) Echo(ctx context.Context, in *sub.StringMessage, opts ...grpc.CallOption) (*sub.StringMessage, error) { + out := new(sub.StringMessage) err := grpc.Invoke(ctx, "/grpc.gateway.examples.examplepb.ABitOfEverythingService/Echo", in, out, c.cc, opts...) if err != nil { return nil, err @@ -598,8 +697,8 @@ func (c *aBitOfEverythingServiceClient) DeepPathEcho(ctx context.Context, in *AB return out, nil } -func (c *aBitOfEverythingServiceClient) NoBindings(ctx context.Context, in *google_protobuf2.Duration, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { - out := new(google_protobuf1.Empty) +func (c *aBitOfEverythingServiceClient) NoBindings(ctx context.Context, in *duration.Duration, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) err := grpc.Invoke(ctx, "/grpc.gateway.examples.examplepb.ABitOfEverythingService/NoBindings", in, out, c.cc, opts...) if err != nil { return nil, err @@ -607,8 +706,8 @@ func (c *aBitOfEverythingServiceClient) NoBindings(ctx context.Context, in *goog return out, nil } -func (c *aBitOfEverythingServiceClient) Timeout(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { - out := new(google_protobuf1.Empty) +func (c *aBitOfEverythingServiceClient) Timeout(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) err := grpc.Invoke(ctx, "/grpc.gateway.examples.examplepb.ABitOfEverythingService/Timeout", in, out, c.cc, opts...) if err != nil { return nil, err @@ -616,8 +715,8 @@ func (c *aBitOfEverythingServiceClient) Timeout(ctx context.Context, in *google_ return out, nil } -func (c *aBitOfEverythingServiceClient) ErrorWithDetails(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { - out := new(google_protobuf1.Empty) +func (c *aBitOfEverythingServiceClient) ErrorWithDetails(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) err := grpc.Invoke(ctx, "/grpc.gateway.examples.examplepb.ABitOfEverythingService/ErrorWithDetails", in, out, c.cc, opts...) if err != nil { return nil, err @@ -625,8 +724,8 @@ func (c *aBitOfEverythingServiceClient) ErrorWithDetails(ctx context.Context, in return out, nil } -func (c *aBitOfEverythingServiceClient) GetMessageWithBody(ctx context.Context, in *MessageWithBody, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { - out := new(google_protobuf1.Empty) +func (c *aBitOfEverythingServiceClient) GetMessageWithBody(ctx context.Context, in *MessageWithBody, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) err := grpc.Invoke(ctx, "/grpc.gateway.examples.examplepb.ABitOfEverythingService/GetMessageWithBody", in, out, c.cc, opts...) if err != nil { return nil, err @@ -634,8 +733,8 @@ func (c *aBitOfEverythingServiceClient) GetMessageWithBody(ctx context.Context, return out, nil } -func (c *aBitOfEverythingServiceClient) PostWithEmptyBody(ctx context.Context, in *Body, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { - out := new(google_protobuf1.Empty) +func (c *aBitOfEverythingServiceClient) PostWithEmptyBody(ctx context.Context, in *Body, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) err := grpc.Invoke(ctx, "/grpc.gateway.examples.examplepb.ABitOfEverythingService/PostWithEmptyBody", in, out, c.cc, opts...) if err != nil { return nil, err @@ -649,9 +748,9 @@ type ABitOfEverythingServiceServer interface { Create(context.Context, *ABitOfEverything) (*ABitOfEverything, error) CreateBody(context.Context, *ABitOfEverything) (*ABitOfEverything, error) Lookup(context.Context, *sub2.IdMessage) (*ABitOfEverything, error) - Update(context.Context, *ABitOfEverything) (*google_protobuf1.Empty, error) - Delete(context.Context, *sub2.IdMessage) (*google_protobuf1.Empty, error) - GetQuery(context.Context, *ABitOfEverything) (*google_protobuf1.Empty, error) + Update(context.Context, *ABitOfEverything) (*empty.Empty, error) + Delete(context.Context, *sub2.IdMessage) (*empty.Empty, error) + GetQuery(context.Context, *ABitOfEverything) (*empty.Empty, error) // Echo allows posting a StringMessage value. // // It also exposes multiple bindings. @@ -659,13 +758,13 @@ type ABitOfEverythingServiceServer interface { // This makes it useful when validating that the OpenAPI v2 API // description exposes documentation correctly on all paths // defined as additional_bindings in the proto. - Echo(context.Context, *grpc_gateway_examples_sub.StringMessage) (*grpc_gateway_examples_sub.StringMessage, error) + Echo(context.Context, *sub.StringMessage) (*sub.StringMessage, error) DeepPathEcho(context.Context, *ABitOfEverything) (*ABitOfEverything, error) - NoBindings(context.Context, *google_protobuf2.Duration) (*google_protobuf1.Empty, error) - Timeout(context.Context, *google_protobuf1.Empty) (*google_protobuf1.Empty, error) - ErrorWithDetails(context.Context, *google_protobuf1.Empty) (*google_protobuf1.Empty, error) - GetMessageWithBody(context.Context, *MessageWithBody) (*google_protobuf1.Empty, error) - PostWithEmptyBody(context.Context, *Body) (*google_protobuf1.Empty, error) + NoBindings(context.Context, *duration.Duration) (*empty.Empty, error) + Timeout(context.Context, *empty.Empty) (*empty.Empty, error) + ErrorWithDetails(context.Context, *empty.Empty) (*empty.Empty, error) + GetMessageWithBody(context.Context, *MessageWithBody) (*empty.Empty, error) + PostWithEmptyBody(context.Context, *Body) (*empty.Empty, error) } func RegisterABitOfEverythingServiceServer(s *grpc.Server, srv ABitOfEverythingServiceServer) { @@ -781,7 +880,7 @@ func _ABitOfEverythingService_GetQuery_Handler(srv interface{}, ctx context.Cont } func _ABitOfEverythingService_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(grpc_gateway_examples_sub.StringMessage) + in := new(sub.StringMessage) if err := dec(in); err != nil { return nil, err } @@ -793,7 +892,7 @@ func _ABitOfEverythingService_Echo_Handler(srv interface{}, ctx context.Context, FullMethod: "/grpc.gateway.examples.examplepb.ABitOfEverythingService/Echo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABitOfEverythingServiceServer).Echo(ctx, req.(*grpc_gateway_examples_sub.StringMessage)) + return srv.(ABitOfEverythingServiceServer).Echo(ctx, req.(*sub.StringMessage)) } return interceptor(ctx, in, info, handler) } @@ -817,7 +916,7 @@ func _ABitOfEverythingService_DeepPathEcho_Handler(srv interface{}, ctx context. } func _ABitOfEverythingService_NoBindings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(google_protobuf2.Duration) + in := new(duration.Duration) if err := dec(in); err != nil { return nil, err } @@ -829,13 +928,13 @@ func _ABitOfEverythingService_NoBindings_Handler(srv interface{}, ctx context.Co FullMethod: "/grpc.gateway.examples.examplepb.ABitOfEverythingService/NoBindings", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABitOfEverythingServiceServer).NoBindings(ctx, req.(*google_protobuf2.Duration)) + return srv.(ABitOfEverythingServiceServer).NoBindings(ctx, req.(*duration.Duration)) } return interceptor(ctx, in, info, handler) } func _ABitOfEverythingService_Timeout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(google_protobuf1.Empty) + in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } @@ -847,13 +946,13 @@ func _ABitOfEverythingService_Timeout_Handler(srv interface{}, ctx context.Conte FullMethod: "/grpc.gateway.examples.examplepb.ABitOfEverythingService/Timeout", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABitOfEverythingServiceServer).Timeout(ctx, req.(*google_protobuf1.Empty)) + return srv.(ABitOfEverythingServiceServer).Timeout(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } func _ABitOfEverythingService_ErrorWithDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(google_protobuf1.Empty) + in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } @@ -865,7 +964,7 @@ func _ABitOfEverythingService_ErrorWithDetails_Handler(srv interface{}, ctx cont FullMethod: "/grpc.gateway.examples.examplepb.ABitOfEverythingService/ErrorWithDetails", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABitOfEverythingServiceServer).ErrorWithDetails(ctx, req.(*google_protobuf1.Empty)) + return srv.(ABitOfEverythingServiceServer).ErrorWithDetails(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } @@ -970,7 +1069,7 @@ var _ABitOfEverythingService_serviceDesc = grpc.ServiceDesc{ // Client API for CamelCaseServiceName service type CamelCaseServiceNameClient interface { - Empty(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + Empty(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) } type camelCaseServiceNameClient struct { @@ -981,8 +1080,8 @@ func NewCamelCaseServiceNameClient(cc *grpc.ClientConn) CamelCaseServiceNameClie return &camelCaseServiceNameClient{cc} } -func (c *camelCaseServiceNameClient) Empty(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { - out := new(google_protobuf1.Empty) +func (c *camelCaseServiceNameClient) Empty(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) err := grpc.Invoke(ctx, "/grpc.gateway.examples.examplepb.camelCaseServiceName/Empty", in, out, c.cc, opts...) if err != nil { return nil, err @@ -993,7 +1092,7 @@ func (c *camelCaseServiceNameClient) Empty(ctx context.Context, in *google_proto // Server API for CamelCaseServiceName service type CamelCaseServiceNameServer interface { - Empty(context.Context, *google_protobuf1.Empty) (*google_protobuf1.Empty, error) + Empty(context.Context, *empty.Empty) (*empty.Empty, error) } func RegisterCamelCaseServiceNameServer(s *grpc.Server, srv CamelCaseServiceNameServer) { @@ -1001,7 +1100,7 @@ func RegisterCamelCaseServiceNameServer(s *grpc.Server, srv CamelCaseServiceName } func _CamelCaseServiceName_Empty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(google_protobuf1.Empty) + in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } @@ -1013,7 +1112,7 @@ func _CamelCaseServiceName_Empty_Handler(srv interface{}, ctx context.Context, d FullMethod: "/grpc.gateway.examples.examplepb.camelCaseServiceName/Empty", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CamelCaseServiceNameServer).Empty(ctx, req.(*google_protobuf1.Empty)) + return srv.(CamelCaseServiceNameServer).Empty(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } @@ -1034,7 +1133,7 @@ var _CamelCaseServiceName_serviceDesc = grpc.ServiceDesc{ // Client API for AnotherServiceWithNoBindings service type AnotherServiceWithNoBindingsClient interface { - NoBindings(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + NoBindings(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) } type anotherServiceWithNoBindingsClient struct { @@ -1045,8 +1144,8 @@ func NewAnotherServiceWithNoBindingsClient(cc *grpc.ClientConn) AnotherServiceWi return &anotherServiceWithNoBindingsClient{cc} } -func (c *anotherServiceWithNoBindingsClient) NoBindings(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { - out := new(google_protobuf1.Empty) +func (c *anotherServiceWithNoBindingsClient) NoBindings(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) err := grpc.Invoke(ctx, "/grpc.gateway.examples.examplepb.AnotherServiceWithNoBindings/NoBindings", in, out, c.cc, opts...) if err != nil { return nil, err @@ -1057,7 +1156,7 @@ func (c *anotherServiceWithNoBindingsClient) NoBindings(ctx context.Context, in // Server API for AnotherServiceWithNoBindings service type AnotherServiceWithNoBindingsServer interface { - NoBindings(context.Context, *google_protobuf1.Empty) (*google_protobuf1.Empty, error) + NoBindings(context.Context, *empty.Empty) (*empty.Empty, error) } func RegisterAnotherServiceWithNoBindingsServer(s *grpc.Server, srv AnotherServiceWithNoBindingsServer) { @@ -1065,7 +1164,7 @@ func RegisterAnotherServiceWithNoBindingsServer(s *grpc.Server, srv AnotherServi } func _AnotherServiceWithNoBindings_NoBindings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(google_protobuf1.Empty) + in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } @@ -1077,7 +1176,7 @@ func _AnotherServiceWithNoBindings_NoBindings_Handler(srv interface{}, ctx conte FullMethod: "/grpc.gateway.examples.examplepb.AnotherServiceWithNoBindings/NoBindings", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AnotherServiceWithNoBindingsServer).NoBindings(ctx, req.(*google_protobuf1.Empty)) + return srv.(AnotherServiceWithNoBindingsServer).NoBindings(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } @@ -1095,9 +1194,11 @@ var _AnotherServiceWithNoBindings_serviceDesc = grpc.ServiceDesc{ Metadata: "examples/proto/examplepb/a_bit_of_everything.proto", } -func init() { proto.RegisterFile("examples/proto/examplepb/a_bit_of_everything.proto", fileDescriptor1) } +func init() { + proto.RegisterFile("examples/proto/examplepb/a_bit_of_everything.proto", fileDescriptor_a_bit_of_everything_f27080d9602a5f10) +} -var fileDescriptor1 = []byte{ +var fileDescriptor_a_bit_of_everything_f27080d9602a5f10 = []byte{ // 2019 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x6f, 0xdb, 0xc8, 0x15, 0xf7, 0x48, 0xb2, 0x22, 0x3d, 0xf9, 0x43, 0x1e, 0xe7, 0xc3, 0x51, 0x9c, 0xf5, 0x44, 0xc9, diff --git a/examples/proto/examplepb/echo_service.pb.go b/examples/proto/examplepb/echo_service.pb.go index f200e4881ac..905eaa93a44 100644 --- a/examples/proto/examplepb/echo_service.pb.go +++ b/examples/proto/examplepb/echo_service.pb.go @@ -1,37 +1,14 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: examples/proto/examplepb/echo_service.proto -/* -Package examplepb is a generated protocol buffer package. +package examplepb +/* Echo Service Echo Service API consists of a single service which returns a message. - -It is generated from these files: - examples/proto/examplepb/echo_service.proto - examples/proto/examplepb/a_bit_of_everything.proto - examples/proto/examplepb/stream.proto - examples/proto/examplepb/flow_combination.proto - examples/proto/examplepb/wrappers.proto - examples/proto/examplepb/unannotated_echo_service.proto - -It has these top-level messages: - Embedded - SimpleMessage - ABitOfEverything - Body - MessageWithBody - EmptyProto - NonEmptyProto - UnaryProto - NestedProto - SingleNestedProto - Wrappers - UnannotatedSimpleMessage */ -package examplepb import proto "github.com/golang/protobuf/proto" import fmt "fmt" @@ -59,13 +36,35 @@ type Embedded struct { // Types that are valid to be assigned to Mark: // *Embedded_Progress // *Embedded_Note - Mark isEmbedded_Mark `protobuf_oneof:"mark"` + Mark isEmbedded_Mark `protobuf_oneof:"mark"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Embedded) Reset() { *m = Embedded{} } -func (m *Embedded) String() string { return proto.CompactTextString(m) } -func (*Embedded) ProtoMessage() {} -func (*Embedded) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *Embedded) Reset() { *m = Embedded{} } +func (m *Embedded) String() string { return proto.CompactTextString(m) } +func (*Embedded) ProtoMessage() {} +func (*Embedded) Descriptor() ([]byte, []int) { + return fileDescriptor_echo_service_c13a64d5f1f0c068, []int{0} +} +func (m *Embedded) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Embedded.Unmarshal(m, b) +} +func (m *Embedded) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Embedded.Marshal(b, m, deterministic) +} +func (dst *Embedded) XXX_Merge(src proto.Message) { + xxx_messageInfo_Embedded.Merge(dst, src) +} +func (m *Embedded) XXX_Size() int { + return xxx_messageInfo_Embedded.Size(m) +} +func (m *Embedded) XXX_DiscardUnknown() { + xxx_messageInfo_Embedded.DiscardUnknown(m) +} + +var xxx_messageInfo_Embedded proto.InternalMessageInfo type isEmbedded_Mark interface { isEmbedded_Mark() @@ -154,10 +153,10 @@ func _Embedded_OneofSizer(msg proto.Message) (n int) { // mark switch x := m.Mark.(type) { case *Embedded_Progress: - n += proto.SizeVarint(1<<3 | proto.WireVarint) + n += 1 // tag and wire n += proto.SizeVarint(uint64(x.Progress)) case *Embedded_Note: - n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(len(x.Note))) n += len(x.Note) case nil: @@ -180,13 +179,35 @@ type SimpleMessage struct { // Types that are valid to be assigned to Ext: // *SimpleMessage_En // *SimpleMessage_No - Ext isSimpleMessage_Ext `protobuf_oneof:"ext"` + Ext isSimpleMessage_Ext `protobuf_oneof:"ext"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SimpleMessage) Reset() { *m = SimpleMessage{} } +func (m *SimpleMessage) String() string { return proto.CompactTextString(m) } +func (*SimpleMessage) ProtoMessage() {} +func (*SimpleMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_echo_service_c13a64d5f1f0c068, []int{1} +} +func (m *SimpleMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SimpleMessage.Unmarshal(m, b) +} +func (m *SimpleMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SimpleMessage.Marshal(b, m, deterministic) +} +func (dst *SimpleMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_SimpleMessage.Merge(dst, src) +} +func (m *SimpleMessage) XXX_Size() int { + return xxx_messageInfo_SimpleMessage.Size(m) +} +func (m *SimpleMessage) XXX_DiscardUnknown() { + xxx_messageInfo_SimpleMessage.DiscardUnknown(m) } -func (m *SimpleMessage) Reset() { *m = SimpleMessage{} } -func (m *SimpleMessage) String() string { return proto.CompactTextString(m) } -func (*SimpleMessage) ProtoMessage() {} -func (*SimpleMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +var xxx_messageInfo_SimpleMessage proto.InternalMessageInfo type isSimpleMessage_Code interface { isSimpleMessage_Code() @@ -358,10 +379,10 @@ func _SimpleMessage_OneofSizer(msg proto.Message) (n int) { // code switch x := m.Code.(type) { case *SimpleMessage_LineNum: - n += proto.SizeVarint(3<<3 | proto.WireVarint) + n += 1 // tag and wire n += proto.SizeVarint(uint64(x.LineNum)) case *SimpleMessage_Lang: - n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(len(x.Lang))) n += len(x.Lang) case nil: @@ -371,11 +392,11 @@ func _SimpleMessage_OneofSizer(msg proto.Message) (n int) { // ext switch x := m.Ext.(type) { case *SimpleMessage_En: - n += proto.SizeVarint(6<<3 | proto.WireVarint) + n += 1 // tag and wire n += proto.SizeVarint(uint64(x.En)) case *SimpleMessage_No: s := proto.Size(x.No) - n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case nil: @@ -540,9 +561,11 @@ var _EchoService_serviceDesc = grpc.ServiceDesc{ Metadata: "examples/proto/examplepb/echo_service.proto", } -func init() { proto.RegisterFile("examples/proto/examplepb/echo_service.proto", fileDescriptor0) } +func init() { + proto.RegisterFile("examples/proto/examplepb/echo_service.proto", fileDescriptor_echo_service_c13a64d5f1f0c068) +} -var fileDescriptor0 = []byte{ +var fileDescriptor_echo_service_c13a64d5f1f0c068 = []byte{ // 470 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x3f, 0x6f, 0xd3, 0x40, 0x14, 0xef, 0xd9, 0x6e, 0x9a, 0xbc, 0x08, 0x54, 0x9d, 0x40, 0x98, 0xb4, 0xa8, 0x91, 0xc5, 0x10, diff --git a/examples/proto/examplepb/flow_combination.pb.go b/examples/proto/examplepb/flow_combination.pb.go index 66e6193cc94..20b2402f9d0 100644 --- a/examples/proto/examplepb/flow_combination.pb.go +++ b/examples/proto/examplepb/flow_combination.pb.go @@ -18,24 +18,74 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + type EmptyProto struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EmptyProto) Reset() { *m = EmptyProto{} } +func (m *EmptyProto) String() string { return proto.CompactTextString(m) } +func (*EmptyProto) ProtoMessage() {} +func (*EmptyProto) Descriptor() ([]byte, []int) { + return fileDescriptor_flow_combination_40371c0acedc1fc5, []int{0} +} +func (m *EmptyProto) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EmptyProto.Unmarshal(m, b) +} +func (m *EmptyProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EmptyProto.Marshal(b, m, deterministic) +} +func (dst *EmptyProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_EmptyProto.Merge(dst, src) +} +func (m *EmptyProto) XXX_Size() int { + return xxx_messageInfo_EmptyProto.Size(m) +} +func (m *EmptyProto) XXX_DiscardUnknown() { + xxx_messageInfo_EmptyProto.DiscardUnknown(m) } -func (m *EmptyProto) Reset() { *m = EmptyProto{} } -func (m *EmptyProto) String() string { return proto.CompactTextString(m) } -func (*EmptyProto) ProtoMessage() {} -func (*EmptyProto) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } +var xxx_messageInfo_EmptyProto proto.InternalMessageInfo type NonEmptyProto struct { - A string `protobuf:"bytes,1,opt,name=a" json:"a,omitempty"` - B string `protobuf:"bytes,2,opt,name=b" json:"b,omitempty"` - C string `protobuf:"bytes,3,opt,name=c" json:"c,omitempty"` + A string `protobuf:"bytes,1,opt,name=a" json:"a,omitempty"` + B string `protobuf:"bytes,2,opt,name=b" json:"b,omitempty"` + C string `protobuf:"bytes,3,opt,name=c" json:"c,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NonEmptyProto) Reset() { *m = NonEmptyProto{} } +func (m *NonEmptyProto) String() string { return proto.CompactTextString(m) } +func (*NonEmptyProto) ProtoMessage() {} +func (*NonEmptyProto) Descriptor() ([]byte, []int) { + return fileDescriptor_flow_combination_40371c0acedc1fc5, []int{1} +} +func (m *NonEmptyProto) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NonEmptyProto.Unmarshal(m, b) +} +func (m *NonEmptyProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NonEmptyProto.Marshal(b, m, deterministic) +} +func (dst *NonEmptyProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_NonEmptyProto.Merge(dst, src) +} +func (m *NonEmptyProto) XXX_Size() int { + return xxx_messageInfo_NonEmptyProto.Size(m) +} +func (m *NonEmptyProto) XXX_DiscardUnknown() { + xxx_messageInfo_NonEmptyProto.DiscardUnknown(m) } -func (m *NonEmptyProto) Reset() { *m = NonEmptyProto{} } -func (m *NonEmptyProto) String() string { return proto.CompactTextString(m) } -func (*NonEmptyProto) ProtoMessage() {} -func (*NonEmptyProto) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } +var xxx_messageInfo_NonEmptyProto proto.InternalMessageInfo func (m *NonEmptyProto) GetA() string { if m != nil { @@ -59,13 +109,35 @@ func (m *NonEmptyProto) GetC() string { } type UnaryProto struct { - Str string `protobuf:"bytes,1,opt,name=str" json:"str,omitempty"` + Str string `protobuf:"bytes,1,opt,name=str" json:"str,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *UnaryProto) Reset() { *m = UnaryProto{} } -func (m *UnaryProto) String() string { return proto.CompactTextString(m) } -func (*UnaryProto) ProtoMessage() {} -func (*UnaryProto) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{2} } +func (m *UnaryProto) Reset() { *m = UnaryProto{} } +func (m *UnaryProto) String() string { return proto.CompactTextString(m) } +func (*UnaryProto) ProtoMessage() {} +func (*UnaryProto) Descriptor() ([]byte, []int) { + return fileDescriptor_flow_combination_40371c0acedc1fc5, []int{2} +} +func (m *UnaryProto) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UnaryProto.Unmarshal(m, b) +} +func (m *UnaryProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UnaryProto.Marshal(b, m, deterministic) +} +func (dst *UnaryProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnaryProto.Merge(dst, src) +} +func (m *UnaryProto) XXX_Size() int { + return xxx_messageInfo_UnaryProto.Size(m) +} +func (m *UnaryProto) XXX_DiscardUnknown() { + xxx_messageInfo_UnaryProto.DiscardUnknown(m) +} + +var xxx_messageInfo_UnaryProto proto.InternalMessageInfo func (m *UnaryProto) GetStr() string { if m != nil { @@ -75,15 +147,37 @@ func (m *UnaryProto) GetStr() string { } type NestedProto struct { - A *UnaryProto `protobuf:"bytes,1,opt,name=a" json:"a,omitempty"` - B string `protobuf:"bytes,2,opt,name=b" json:"b,omitempty"` - C string `protobuf:"bytes,3,opt,name=c" json:"c,omitempty"` + A *UnaryProto `protobuf:"bytes,1,opt,name=a" json:"a,omitempty"` + B string `protobuf:"bytes,2,opt,name=b" json:"b,omitempty"` + C string `protobuf:"bytes,3,opt,name=c" json:"c,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NestedProto) Reset() { *m = NestedProto{} } +func (m *NestedProto) String() string { return proto.CompactTextString(m) } +func (*NestedProto) ProtoMessage() {} +func (*NestedProto) Descriptor() ([]byte, []int) { + return fileDescriptor_flow_combination_40371c0acedc1fc5, []int{3} +} +func (m *NestedProto) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NestedProto.Unmarshal(m, b) +} +func (m *NestedProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NestedProto.Marshal(b, m, deterministic) +} +func (dst *NestedProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_NestedProto.Merge(dst, src) +} +func (m *NestedProto) XXX_Size() int { + return xxx_messageInfo_NestedProto.Size(m) +} +func (m *NestedProto) XXX_DiscardUnknown() { + xxx_messageInfo_NestedProto.DiscardUnknown(m) } -func (m *NestedProto) Reset() { *m = NestedProto{} } -func (m *NestedProto) String() string { return proto.CompactTextString(m) } -func (*NestedProto) ProtoMessage() {} -func (*NestedProto) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{3} } +var xxx_messageInfo_NestedProto proto.InternalMessageInfo func (m *NestedProto) GetA() *UnaryProto { if m != nil { @@ -107,13 +201,35 @@ func (m *NestedProto) GetC() string { } type SingleNestedProto struct { - A *UnaryProto `protobuf:"bytes,1,opt,name=a" json:"a,omitempty"` + A *UnaryProto `protobuf:"bytes,1,opt,name=a" json:"a,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *SingleNestedProto) Reset() { *m = SingleNestedProto{} } -func (m *SingleNestedProto) String() string { return proto.CompactTextString(m) } -func (*SingleNestedProto) ProtoMessage() {} -func (*SingleNestedProto) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{4} } +func (m *SingleNestedProto) Reset() { *m = SingleNestedProto{} } +func (m *SingleNestedProto) String() string { return proto.CompactTextString(m) } +func (*SingleNestedProto) ProtoMessage() {} +func (*SingleNestedProto) Descriptor() ([]byte, []int) { + return fileDescriptor_flow_combination_40371c0acedc1fc5, []int{4} +} +func (m *SingleNestedProto) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SingleNestedProto.Unmarshal(m, b) +} +func (m *SingleNestedProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SingleNestedProto.Marshal(b, m, deterministic) +} +func (dst *SingleNestedProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_SingleNestedProto.Merge(dst, src) +} +func (m *SingleNestedProto) XXX_Size() int { + return xxx_messageInfo_SingleNestedProto.Size(m) +} +func (m *SingleNestedProto) XXX_DiscardUnknown() { + xxx_messageInfo_SingleNestedProto.DiscardUnknown(m) +} + +var xxx_messageInfo_SingleNestedProto proto.InternalMessageInfo func (m *SingleNestedProto) GetA() *UnaryProto { if m != nil { @@ -674,9 +790,11 @@ var _FlowCombination_serviceDesc = grpc.ServiceDesc{ Metadata: "examples/proto/examplepb/flow_combination.proto", } -func init() { proto.RegisterFile("examples/proto/examplepb/flow_combination.proto", fileDescriptor3) } +func init() { + proto.RegisterFile("examples/proto/examplepb/flow_combination.proto", fileDescriptor_flow_combination_40371c0acedc1fc5) +} -var fileDescriptor3 = []byte{ +var fileDescriptor_flow_combination_40371c0acedc1fc5 = []byte{ // 655 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x96, 0xbf, 0x8f, 0x12, 0x41, 0x14, 0xc7, 0xf3, 0xb8, 0xc4, 0xe4, 0x86, 0xfb, 0xc1, 0x2d, 0x06, 0x81, 0xc3, 0xe3, 0x6e, 0xbc, diff --git a/examples/proto/examplepb/stream.pb.go b/examples/proto/examplepb/stream.pb.go index 1f1a74bfdeb..c598d8a548b 100644 --- a/examples/proto/examplepb/stream.pb.go +++ b/examples/proto/examplepb/stream.pb.go @@ -6,9 +6,9 @@ package examplepb import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import empty "github.com/golang/protobuf/ptypes/empty" +import sub "github.com/grpc-ecosystem/grpc-gateway/examples/proto/sub" import _ "google.golang.org/genproto/googleapis/api/annotations" -import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" -import grpc_gateway_examples_sub "github.com/grpc-ecosystem/grpc-gateway/examples/proto/sub" import ( context "golang.org/x/net/context" @@ -20,6 +20,12 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn @@ -32,7 +38,7 @@ const _ = grpc.SupportPackageIsVersion4 type StreamServiceClient interface { BulkCreate(ctx context.Context, opts ...grpc.CallOption) (StreamService_BulkCreateClient, error) - List(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (StreamService_ListClient, error) + List(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (StreamService_ListClient, error) BulkEcho(ctx context.Context, opts ...grpc.CallOption) (StreamService_BulkEchoClient, error) } @@ -55,7 +61,7 @@ func (c *streamServiceClient) BulkCreate(ctx context.Context, opts ...grpc.CallO type StreamService_BulkCreateClient interface { Send(*ABitOfEverything) error - CloseAndRecv() (*google_protobuf1.Empty, error) + CloseAndRecv() (*empty.Empty, error) grpc.ClientStream } @@ -67,18 +73,18 @@ func (x *streamServiceBulkCreateClient) Send(m *ABitOfEverything) error { return x.ClientStream.SendMsg(m) } -func (x *streamServiceBulkCreateClient) CloseAndRecv() (*google_protobuf1.Empty, error) { +func (x *streamServiceBulkCreateClient) CloseAndRecv() (*empty.Empty, error) { if err := x.ClientStream.CloseSend(); err != nil { return nil, err } - m := new(google_protobuf1.Empty) + m := new(empty.Empty) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } -func (c *streamServiceClient) List(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (StreamService_ListClient, error) { +func (c *streamServiceClient) List(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (StreamService_ListClient, error) { stream, err := grpc.NewClientStream(ctx, &_StreamService_serviceDesc.Streams[1], c.cc, "/grpc.gateway.examples.examplepb.StreamService/List", opts...) if err != nil { return nil, err @@ -120,8 +126,8 @@ func (c *streamServiceClient) BulkEcho(ctx context.Context, opts ...grpc.CallOpt } type StreamService_BulkEchoClient interface { - Send(*grpc_gateway_examples_sub.StringMessage) error - Recv() (*grpc_gateway_examples_sub.StringMessage, error) + Send(*sub.StringMessage) error + Recv() (*sub.StringMessage, error) grpc.ClientStream } @@ -129,12 +135,12 @@ type streamServiceBulkEchoClient struct { grpc.ClientStream } -func (x *streamServiceBulkEchoClient) Send(m *grpc_gateway_examples_sub.StringMessage) error { +func (x *streamServiceBulkEchoClient) Send(m *sub.StringMessage) error { return x.ClientStream.SendMsg(m) } -func (x *streamServiceBulkEchoClient) Recv() (*grpc_gateway_examples_sub.StringMessage, error) { - m := new(grpc_gateway_examples_sub.StringMessage) +func (x *streamServiceBulkEchoClient) Recv() (*sub.StringMessage, error) { + m := new(sub.StringMessage) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } @@ -145,7 +151,7 @@ func (x *streamServiceBulkEchoClient) Recv() (*grpc_gateway_examples_sub.StringM type StreamServiceServer interface { BulkCreate(StreamService_BulkCreateServer) error - List(*google_protobuf1.Empty, StreamService_ListServer) error + List(*empty.Empty, StreamService_ListServer) error BulkEcho(StreamService_BulkEchoServer) error } @@ -158,7 +164,7 @@ func _StreamService_BulkCreate_Handler(srv interface{}, stream grpc.ServerStream } type StreamService_BulkCreateServer interface { - SendAndClose(*google_protobuf1.Empty) error + SendAndClose(*empty.Empty) error Recv() (*ABitOfEverything, error) grpc.ServerStream } @@ -167,7 +173,7 @@ type streamServiceBulkCreateServer struct { grpc.ServerStream } -func (x *streamServiceBulkCreateServer) SendAndClose(m *google_protobuf1.Empty) error { +func (x *streamServiceBulkCreateServer) SendAndClose(m *empty.Empty) error { return x.ServerStream.SendMsg(m) } @@ -180,7 +186,7 @@ func (x *streamServiceBulkCreateServer) Recv() (*ABitOfEverything, error) { } func _StreamService_List_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(google_protobuf1.Empty) + m := new(empty.Empty) if err := stream.RecvMsg(m); err != nil { return err } @@ -205,8 +211,8 @@ func _StreamService_BulkEcho_Handler(srv interface{}, stream grpc.ServerStream) } type StreamService_BulkEchoServer interface { - Send(*grpc_gateway_examples_sub.StringMessage) error - Recv() (*grpc_gateway_examples_sub.StringMessage, error) + Send(*sub.StringMessage) error + Recv() (*sub.StringMessage, error) grpc.ServerStream } @@ -214,12 +220,12 @@ type streamServiceBulkEchoServer struct { grpc.ServerStream } -func (x *streamServiceBulkEchoServer) Send(m *grpc_gateway_examples_sub.StringMessage) error { +func (x *streamServiceBulkEchoServer) Send(m *sub.StringMessage) error { return x.ServerStream.SendMsg(m) } -func (x *streamServiceBulkEchoServer) Recv() (*grpc_gateway_examples_sub.StringMessage, error) { - m := new(grpc_gateway_examples_sub.StringMessage) +func (x *streamServiceBulkEchoServer) Recv() (*sub.StringMessage, error) { + m := new(sub.StringMessage) if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } @@ -251,9 +257,11 @@ var _StreamService_serviceDesc = grpc.ServiceDesc{ Metadata: "examples/proto/examplepb/stream.proto", } -func init() { proto.RegisterFile("examples/proto/examplepb/stream.proto", fileDescriptor2) } +func init() { + proto.RegisterFile("examples/proto/examplepb/stream.proto", fileDescriptor_stream_0929397c5d8d3331) +} -var fileDescriptor2 = []byte{ +var fileDescriptor_stream_0929397c5d8d3331 = []byte{ // 319 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x90, 0xb1, 0x4e, 0xc3, 0x30, 0x10, 0x86, 0x15, 0x40, 0x08, 0x8c, 0x58, 0x3c, 0x30, 0x04, 0xa4, 0x42, 0x05, 0xa2, 0x30, 0xd8, diff --git a/examples/proto/examplepb/unannotated_echo_service.pb.go b/examples/proto/examplepb/unannotated_echo_service.pb.go index 4e3aebeba13..7e2dd22f1c7 100644 --- a/examples/proto/examplepb/unannotated_echo_service.pb.go +++ b/examples/proto/examplepb/unannotated_echo_service.pb.go @@ -3,10 +3,20 @@ package examplepb +/* +Unannotated Echo Service +Similar to echo_service.proto but without annotations. See +unannotated_echo_service.yaml for the equivalent of the annotations in +gRPC API configuration format. + +Echo Service API consists of a single service which returns +a message. +*/ + import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import google_protobuf2 "github.com/golang/protobuf/ptypes/duration" +import duration "github.com/golang/protobuf/ptypes/duration" import ( context "golang.org/x/net/context" @@ -18,18 +28,46 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + // UnannotatedSimpleMessage represents a simple message sent to the unannotated Echo service. type UnannotatedSimpleMessage struct { // Id represents the message identifier. - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Num int64 `protobuf:"varint,2,opt,name=num" json:"num,omitempty"` - Duration *google_protobuf2.Duration `protobuf:"bytes,3,opt,name=duration" json:"duration,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Num int64 `protobuf:"varint,2,opt,name=num" json:"num,omitempty"` + Duration *duration.Duration `protobuf:"bytes,3,opt,name=duration" json:"duration,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UnannotatedSimpleMessage) Reset() { *m = UnannotatedSimpleMessage{} } +func (m *UnannotatedSimpleMessage) String() string { return proto.CompactTextString(m) } +func (*UnannotatedSimpleMessage) ProtoMessage() {} +func (*UnannotatedSimpleMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_unannotated_echo_service_33987b03bf51a339, []int{0} +} +func (m *UnannotatedSimpleMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UnannotatedSimpleMessage.Unmarshal(m, b) +} +func (m *UnannotatedSimpleMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UnannotatedSimpleMessage.Marshal(b, m, deterministic) +} +func (dst *UnannotatedSimpleMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnannotatedSimpleMessage.Merge(dst, src) +} +func (m *UnannotatedSimpleMessage) XXX_Size() int { + return xxx_messageInfo_UnannotatedSimpleMessage.Size(m) +} +func (m *UnannotatedSimpleMessage) XXX_DiscardUnknown() { + xxx_messageInfo_UnannotatedSimpleMessage.DiscardUnknown(m) } -func (m *UnannotatedSimpleMessage) Reset() { *m = UnannotatedSimpleMessage{} } -func (m *UnannotatedSimpleMessage) String() string { return proto.CompactTextString(m) } -func (*UnannotatedSimpleMessage) ProtoMessage() {} -func (*UnannotatedSimpleMessage) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} } +var xxx_messageInfo_UnannotatedSimpleMessage proto.InternalMessageInfo func (m *UnannotatedSimpleMessage) GetId() string { if m != nil { @@ -45,7 +83,7 @@ func (m *UnannotatedSimpleMessage) GetNum() int64 { return 0 } -func (m *UnannotatedSimpleMessage) GetDuration() *google_protobuf2.Duration { +func (m *UnannotatedSimpleMessage) GetDuration() *duration.Duration { if m != nil { return m.Duration } @@ -207,10 +245,10 @@ var _UnannotatedEchoService_serviceDesc = grpc.ServiceDesc{ } func init() { - proto.RegisterFile("examples/proto/examplepb/unannotated_echo_service.proto", fileDescriptor5) + proto.RegisterFile("examples/proto/examplepb/unannotated_echo_service.proto", fileDescriptor_unannotated_echo_service_33987b03bf51a339) } -var fileDescriptor5 = []byte{ +var fileDescriptor_unannotated_echo_service_33987b03bf51a339 = []byte{ // 268 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x4f, 0xad, 0x48, 0xcc, 0x2d, 0xc8, 0x49, 0x2d, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x87, 0x72, 0x0b, 0x92, 0xf4, diff --git a/examples/proto/examplepb/wrappers.pb.go b/examples/proto/examplepb/wrappers.pb.go index be6f14bf6fb..878c410dc3e 100644 --- a/examples/proto/examplepb/wrappers.pb.go +++ b/examples/proto/examplepb/wrappers.pb.go @@ -6,8 +6,8 @@ package examplepb import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import wrappers "github.com/golang/protobuf/ptypes/wrappers" import _ "google.golang.org/genproto/googleapis/api/annotations" -import google_protobuf5 "github.com/golang/protobuf/ptypes/wrappers" import ( context "golang.org/x/net/context" @@ -19,56 +19,84 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + type Wrappers struct { - StringValue *google_protobuf5.StringValue `protobuf:"bytes,1,opt,name=string_value,json=stringValue" json:"string_value,omitempty"` - Int32Value *google_protobuf5.Int32Value `protobuf:"bytes,2,opt,name=int32_value,json=int32Value" json:"int32_value,omitempty"` - Int64Value *google_protobuf5.Int64Value `protobuf:"bytes,3,opt,name=int64_value,json=int64Value" json:"int64_value,omitempty"` - FloatValue *google_protobuf5.FloatValue `protobuf:"bytes,4,opt,name=float_value,json=floatValue" json:"float_value,omitempty"` - DoubleValue *google_protobuf5.DoubleValue `protobuf:"bytes,5,opt,name=double_value,json=doubleValue" json:"double_value,omitempty"` - BoolValue *google_protobuf5.BoolValue `protobuf:"bytes,6,opt,name=bool_value,json=boolValue" json:"bool_value,omitempty"` + StringValue *wrappers.StringValue `protobuf:"bytes,1,opt,name=string_value,json=stringValue" json:"string_value,omitempty"` + Int32Value *wrappers.Int32Value `protobuf:"bytes,2,opt,name=int32_value,json=int32Value" json:"int32_value,omitempty"` + Int64Value *wrappers.Int64Value `protobuf:"bytes,3,opt,name=int64_value,json=int64Value" json:"int64_value,omitempty"` + FloatValue *wrappers.FloatValue `protobuf:"bytes,4,opt,name=float_value,json=floatValue" json:"float_value,omitempty"` + DoubleValue *wrappers.DoubleValue `protobuf:"bytes,5,opt,name=double_value,json=doubleValue" json:"double_value,omitempty"` + BoolValue *wrappers.BoolValue `protobuf:"bytes,6,opt,name=bool_value,json=boolValue" json:"bool_value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Wrappers) Reset() { *m = Wrappers{} } -func (m *Wrappers) String() string { return proto.CompactTextString(m) } -func (*Wrappers) ProtoMessage() {} -func (*Wrappers) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } +func (m *Wrappers) Reset() { *m = Wrappers{} } +func (m *Wrappers) String() string { return proto.CompactTextString(m) } +func (*Wrappers) ProtoMessage() {} +func (*Wrappers) Descriptor() ([]byte, []int) { + return fileDescriptor_wrappers_c39e75a579a3cddc, []int{0} +} +func (m *Wrappers) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Wrappers.Unmarshal(m, b) +} +func (m *Wrappers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Wrappers.Marshal(b, m, deterministic) +} +func (dst *Wrappers) XXX_Merge(src proto.Message) { + xxx_messageInfo_Wrappers.Merge(dst, src) +} +func (m *Wrappers) XXX_Size() int { + return xxx_messageInfo_Wrappers.Size(m) +} +func (m *Wrappers) XXX_DiscardUnknown() { + xxx_messageInfo_Wrappers.DiscardUnknown(m) +} + +var xxx_messageInfo_Wrappers proto.InternalMessageInfo -func (m *Wrappers) GetStringValue() *google_protobuf5.StringValue { +func (m *Wrappers) GetStringValue() *wrappers.StringValue { if m != nil { return m.StringValue } return nil } -func (m *Wrappers) GetInt32Value() *google_protobuf5.Int32Value { +func (m *Wrappers) GetInt32Value() *wrappers.Int32Value { if m != nil { return m.Int32Value } return nil } -func (m *Wrappers) GetInt64Value() *google_protobuf5.Int64Value { +func (m *Wrappers) GetInt64Value() *wrappers.Int64Value { if m != nil { return m.Int64Value } return nil } -func (m *Wrappers) GetFloatValue() *google_protobuf5.FloatValue { +func (m *Wrappers) GetFloatValue() *wrappers.FloatValue { if m != nil { return m.FloatValue } return nil } -func (m *Wrappers) GetDoubleValue() *google_protobuf5.DoubleValue { +func (m *Wrappers) GetDoubleValue() *wrappers.DoubleValue { if m != nil { return m.DoubleValue } return nil } -func (m *Wrappers) GetBoolValue() *google_protobuf5.BoolValue { +func (m *Wrappers) GetBoolValue() *wrappers.BoolValue { if m != nil { return m.BoolValue } @@ -151,9 +179,11 @@ var _WrappersService_serviceDesc = grpc.ServiceDesc{ Metadata: "examples/proto/examplepb/wrappers.proto", } -func init() { proto.RegisterFile("examples/proto/examplepb/wrappers.proto", fileDescriptor4) } +func init() { + proto.RegisterFile("examples/proto/examplepb/wrappers.proto", fileDescriptor_wrappers_c39e75a579a3cddc) +} -var fileDescriptor4 = []byte{ +var fileDescriptor_wrappers_c39e75a579a3cddc = []byte{ // 333 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0xd2, 0xcf, 0x4a, 0x3b, 0x31, 0x10, 0x07, 0x70, 0xb6, 0xfd, 0xfd, 0x8a, 0xcd, 0x0a, 0xc2, 0xe2, 0x41, 0xd7, 0x62, 0xa5, 0x17, diff --git a/examples/proto/sub/message.pb.go b/examples/proto/sub/message.pb.go index 7d4ec6acf4b..81612434029 100644 --- a/examples/proto/sub/message.pb.go +++ b/examples/proto/sub/message.pb.go @@ -1,15 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: examples/proto/sub/message.proto -/* -Package sub is a generated protocol buffer package. - -It is generated from these files: - examples/proto/sub/message.proto - -It has these top-level messages: - StringMessage -*/ package sub import proto "github.com/golang/protobuf/proto" @@ -28,14 +19,35 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type StringMessage struct { - Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` + Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *StringMessage) Reset() { *m = StringMessage{} } -func (m *StringMessage) String() string { return proto.CompactTextString(m) } -func (*StringMessage) ProtoMessage() {} -func (*StringMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *StringMessage) Reset() { *m = StringMessage{} } +func (m *StringMessage) String() string { return proto.CompactTextString(m) } +func (*StringMessage) ProtoMessage() {} +func (*StringMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_message_c180d3d1a4bbfe02, []int{0} +} +func (m *StringMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StringMessage.Unmarshal(m, b) +} +func (m *StringMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StringMessage.Marshal(b, m, deterministic) +} +func (dst *StringMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_StringMessage.Merge(dst, src) +} +func (m *StringMessage) XXX_Size() int { + return xxx_messageInfo_StringMessage.Size(m) +} +func (m *StringMessage) XXX_DiscardUnknown() { + xxx_messageInfo_StringMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_StringMessage proto.InternalMessageInfo func (m *StringMessage) GetValue() string { if m != nil && m.Value != nil { @@ -48,9 +60,11 @@ func init() { proto.RegisterType((*StringMessage)(nil), "grpc.gateway.examples.sub.StringMessage") } -func init() { proto.RegisterFile("examples/proto/sub/message.proto", fileDescriptor0) } +func init() { + proto.RegisterFile("examples/proto/sub/message.proto", fileDescriptor_message_c180d3d1a4bbfe02) +} -var fileDescriptor0 = []byte{ +var fileDescriptor_message_c180d3d1a4bbfe02 = []byte{ // 114 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xad, 0x48, 0xcc, 0x2d, 0xc8, 0x49, 0x2d, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x2f, 0x2e, 0x4d, 0xd2, 0xcf, diff --git a/examples/proto/sub2/message.pb.go b/examples/proto/sub2/message.pb.go index 156774b7d3f..a0a812c7d0f 100644 --- a/examples/proto/sub2/message.pb.go +++ b/examples/proto/sub2/message.pb.go @@ -1,16 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: examples/proto/sub2/message.proto -/* -Package sub2 is a generated protocol buffer package. - -It is generated from these files: - examples/proto/sub2/message.proto - -It has these top-level messages: - IdMessage -*/ -package sub2 +package sub2 // import "github.com/grpc-ecosystem/grpc-gateway/examples/proto/sub2" import proto "github.com/golang/protobuf/proto" import fmt "fmt" @@ -28,13 +19,35 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type IdMessage struct { - Uuid string `protobuf:"bytes,1,opt,name=uuid" json:"uuid,omitempty"` + Uuid string `protobuf:"bytes,1,opt,name=uuid" json:"uuid,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *IdMessage) Reset() { *m = IdMessage{} } -func (m *IdMessage) String() string { return proto.CompactTextString(m) } -func (*IdMessage) ProtoMessage() {} -func (*IdMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *IdMessage) Reset() { *m = IdMessage{} } +func (m *IdMessage) String() string { return proto.CompactTextString(m) } +func (*IdMessage) ProtoMessage() {} +func (*IdMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_message_1fa155de06adc960, []int{0} +} +func (m *IdMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_IdMessage.Unmarshal(m, b) +} +func (m *IdMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_IdMessage.Marshal(b, m, deterministic) +} +func (dst *IdMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_IdMessage.Merge(dst, src) +} +func (m *IdMessage) XXX_Size() int { + return xxx_messageInfo_IdMessage.Size(m) +} +func (m *IdMessage) XXX_DiscardUnknown() { + xxx_messageInfo_IdMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_IdMessage proto.InternalMessageInfo func (m *IdMessage) GetUuid() string { if m != nil { @@ -47,9 +60,11 @@ func init() { proto.RegisterType((*IdMessage)(nil), "sub2.IdMessage") } -func init() { proto.RegisterFile("examples/proto/sub2/message.proto", fileDescriptor0) } +func init() { + proto.RegisterFile("examples/proto/sub2/message.proto", fileDescriptor_message_1fa155de06adc960) +} -var fileDescriptor0 = []byte{ +var fileDescriptor_message_1fa155de06adc960 = []byte{ // 130 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xad, 0x48, 0xcc, 0x2d, 0xc8, 0x49, 0x2d, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x2f, 0x2e, 0x4d, 0x32, 0xd2, diff --git a/protoc-gen-swagger/options/annotations.pb.go b/protoc-gen-swagger/options/annotations.pb.go index 7bc93b91c63..b8fffb69a0e 100644 --- a/protoc-gen-swagger/options/annotations.pb.go +++ b/protoc-gen-swagger/options/annotations.pb.go @@ -1,20 +1,26 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: protoc-gen-swagger/options/annotations.proto -package options +package options // import "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import google_protobuf1 "github.com/golang/protobuf/protoc-gen-go/descriptor" +import descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + var E_Openapiv2Swagger = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf1.FileOptions)(nil), + ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*Swagger)(nil), Field: 1042, Name: "grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger", @@ -23,7 +29,7 @@ var E_Openapiv2Swagger = &proto.ExtensionDesc{ } var E_Openapiv2Operation = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf1.MethodOptions)(nil), + ExtendedType: (*descriptor.MethodOptions)(nil), ExtensionType: (*Operation)(nil), Field: 1042, Name: "grpc.gateway.protoc_gen_swagger.options.openapiv2_operation", @@ -32,7 +38,7 @@ var E_Openapiv2Operation = &proto.ExtensionDesc{ } var E_Openapiv2Schema = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf1.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*Schema)(nil), Field: 1042, Name: "grpc.gateway.protoc_gen_swagger.options.openapiv2_schema", @@ -41,7 +47,7 @@ var E_Openapiv2Schema = &proto.ExtensionDesc{ } var E_Openapiv2Tag = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf1.ServiceOptions)(nil), + ExtendedType: (*descriptor.ServiceOptions)(nil), ExtensionType: (*Tag)(nil), Field: 1042, Name: "grpc.gateway.protoc_gen_swagger.options.openapiv2_tag", @@ -56,9 +62,11 @@ func init() { proto.RegisterExtension(E_Openapiv2Tag) } -func init() { proto.RegisterFile("protoc-gen-swagger/options/annotations.proto", fileDescriptor1) } +func init() { + proto.RegisterFile("protoc-gen-swagger/options/annotations.proto", fileDescriptor_annotations_a3ffb1266b13d7a2) +} -var fileDescriptor1 = []byte{ +var fileDescriptor_annotations_a3ffb1266b13d7a2 = []byte{ // 311 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x4b, 0x03, 0x31, 0x10, 0x85, 0xe9, 0x45, 0x64, 0x55, 0xac, 0xeb, 0x45, 0x8a, 0x68, 0x6f, 0x8a, 0xb4, 0x89, 0xd4, diff --git a/protoc-gen-swagger/options/openapiv2.pb.go b/protoc-gen-swagger/options/openapiv2.pb.go index 1b639f78d56..be2342b7154 100644 --- a/protoc-gen-swagger/options/openapiv2.pb.go +++ b/protoc-gen-swagger/options/openapiv2.pb.go @@ -1,33 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: protoc-gen-swagger/options/openapiv2.proto -/* -Package options is a generated protocol buffer package. - -It is generated from these files: - protoc-gen-swagger/options/openapiv2.proto - protoc-gen-swagger/options/annotations.proto - -It has these top-level messages: - Swagger - Operation - Info - Contact - ExternalDocumentation - Schema - JSONSchema - Tag - SecurityDefinitions - SecurityScheme - SecurityRequirement - Scopes -*/ -package options +package options // import "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import google_protobuf "github.com/golang/protobuf/ptypes/any" +import any "github.com/golang/protobuf/ptypes/any" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -68,7 +47,9 @@ var Swagger_SwaggerScheme_value = map[string]int32{ func (x Swagger_SwaggerScheme) String() string { return proto.EnumName(Swagger_SwaggerScheme_name, int32(x)) } -func (Swagger_SwaggerScheme) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } +func (Swagger_SwaggerScheme) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{0, 0} +} type JSONSchema_JSONSchemaSimpleTypes int32 @@ -108,7 +89,7 @@ func (x JSONSchema_JSONSchemaSimpleTypes) String() string { return proto.EnumName(JSONSchema_JSONSchemaSimpleTypes_name, int32(x)) } func (JSONSchema_JSONSchemaSimpleTypes) EnumDescriptor() ([]byte, []int) { - return fileDescriptor0, []int{6, 0} + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{6, 0} } // Required. The type of the security scheme. Valid values are "basic", @@ -138,7 +119,9 @@ var SecurityScheme_Type_value = map[string]int32{ func (x SecurityScheme_Type) String() string { return proto.EnumName(SecurityScheme_Type_name, int32(x)) } -func (SecurityScheme_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{9, 0} } +func (SecurityScheme_Type) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{9, 0} +} // Required. The location of the API key. Valid values are "query" or "header". type SecurityScheme_In int32 @@ -163,7 +146,9 @@ var SecurityScheme_In_value = map[string]int32{ func (x SecurityScheme_In) String() string { return proto.EnumName(SecurityScheme_In_name, int32(x)) } -func (SecurityScheme_In) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{9, 1} } +func (SecurityScheme_In) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{9, 1} +} // Required. The flow used by the OAuth2 security scheme. Valid values are // "implicit", "password", "application" or "accessCode". @@ -195,7 +180,9 @@ var SecurityScheme_Flow_value = map[string]int32{ func (x SecurityScheme_Flow) String() string { return proto.EnumName(SecurityScheme_Flow_name, int32(x)) } -func (SecurityScheme_Flow) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{9, 2} } +func (SecurityScheme_Flow) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{9, 2} +} // `Swagger` is a representation of OpenAPI v2 specification's Swagger object. // @@ -203,22 +190,44 @@ func (SecurityScheme_Flow) EnumDescriptor() ([]byte, []int) { return fileDescrip // // TODO(ivucica): document fields type Swagger struct { - Swagger string `protobuf:"bytes,1,opt,name=swagger" json:"swagger,omitempty"` - Info *Info `protobuf:"bytes,2,opt,name=info" json:"info,omitempty"` - Host string `protobuf:"bytes,3,opt,name=host" json:"host,omitempty"` - BasePath string `protobuf:"bytes,4,opt,name=base_path,json=basePath" json:"base_path,omitempty"` - Schemes []Swagger_SwaggerScheme `protobuf:"varint,5,rep,packed,name=schemes,enum=grpc.gateway.protoc_gen_swagger.options.Swagger_SwaggerScheme" json:"schemes,omitempty"` - Consumes []string `protobuf:"bytes,6,rep,name=consumes" json:"consumes,omitempty"` - Produces []string `protobuf:"bytes,7,rep,name=produces" json:"produces,omitempty"` - SecurityDefinitions *SecurityDefinitions `protobuf:"bytes,11,opt,name=security_definitions,json=securityDefinitions" json:"security_definitions,omitempty"` - Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security" json:"security,omitempty"` - ExternalDocs *ExternalDocumentation `protobuf:"bytes,14,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` -} - -func (m *Swagger) Reset() { *m = Swagger{} } -func (m *Swagger) String() string { return proto.CompactTextString(m) } -func (*Swagger) ProtoMessage() {} -func (*Swagger) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + Swagger string `protobuf:"bytes,1,opt,name=swagger" json:"swagger,omitempty"` + Info *Info `protobuf:"bytes,2,opt,name=info" json:"info,omitempty"` + Host string `protobuf:"bytes,3,opt,name=host" json:"host,omitempty"` + BasePath string `protobuf:"bytes,4,opt,name=base_path,json=basePath" json:"base_path,omitempty"` + Schemes []Swagger_SwaggerScheme `protobuf:"varint,5,rep,packed,name=schemes,enum=grpc.gateway.protoc_gen_swagger.options.Swagger_SwaggerScheme" json:"schemes,omitempty"` + Consumes []string `protobuf:"bytes,6,rep,name=consumes" json:"consumes,omitempty"` + Produces []string `protobuf:"bytes,7,rep,name=produces" json:"produces,omitempty"` + SecurityDefinitions *SecurityDefinitions `protobuf:"bytes,11,opt,name=security_definitions,json=securityDefinitions" json:"security_definitions,omitempty"` + Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security" json:"security,omitempty"` + ExternalDocs *ExternalDocumentation `protobuf:"bytes,14,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Swagger) Reset() { *m = Swagger{} } +func (m *Swagger) String() string { return proto.CompactTextString(m) } +func (*Swagger) ProtoMessage() {} +func (*Swagger) Descriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{0} +} +func (m *Swagger) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Swagger.Unmarshal(m, b) +} +func (m *Swagger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Swagger.Marshal(b, m, deterministic) +} +func (dst *Swagger) XXX_Merge(src proto.Message) { + xxx_messageInfo_Swagger.Merge(dst, src) +} +func (m *Swagger) XXX_Size() int { + return xxx_messageInfo_Swagger.Size(m) +} +func (m *Swagger) XXX_DiscardUnknown() { + xxx_messageInfo_Swagger.DiscardUnknown(m) +} + +var xxx_messageInfo_Swagger proto.InternalMessageInfo func (m *Swagger) GetSwagger() string { if m != nil { @@ -296,22 +305,44 @@ func (m *Swagger) GetExternalDocs() *ExternalDocumentation { // // TODO(ivucica): document fields type Operation struct { - Tags []string `protobuf:"bytes,1,rep,name=tags" json:"tags,omitempty"` - Summary string `protobuf:"bytes,2,opt,name=summary" json:"summary,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` - ExternalDocs *ExternalDocumentation `protobuf:"bytes,4,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` - OperationId string `protobuf:"bytes,5,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` - Consumes []string `protobuf:"bytes,6,rep,name=consumes" json:"consumes,omitempty"` - Produces []string `protobuf:"bytes,7,rep,name=produces" json:"produces,omitempty"` - Schemes []string `protobuf:"bytes,10,rep,name=schemes" json:"schemes,omitempty"` - Deprecated bool `protobuf:"varint,11,opt,name=deprecated" json:"deprecated,omitempty"` - Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security" json:"security,omitempty"` -} - -func (m *Operation) Reset() { *m = Operation{} } -func (m *Operation) String() string { return proto.CompactTextString(m) } -func (*Operation) ProtoMessage() {} -func (*Operation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + Tags []string `protobuf:"bytes,1,rep,name=tags" json:"tags,omitempty"` + Summary string `protobuf:"bytes,2,opt,name=summary" json:"summary,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` + ExternalDocs *ExternalDocumentation `protobuf:"bytes,4,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` + OperationId string `protobuf:"bytes,5,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` + Consumes []string `protobuf:"bytes,6,rep,name=consumes" json:"consumes,omitempty"` + Produces []string `protobuf:"bytes,7,rep,name=produces" json:"produces,omitempty"` + Schemes []string `protobuf:"bytes,10,rep,name=schemes" json:"schemes,omitempty"` + Deprecated bool `protobuf:"varint,11,opt,name=deprecated" json:"deprecated,omitempty"` + Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security" json:"security,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Operation) Reset() { *m = Operation{} } +func (m *Operation) String() string { return proto.CompactTextString(m) } +func (*Operation) ProtoMessage() {} +func (*Operation) Descriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{1} +} +func (m *Operation) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Operation.Unmarshal(m, b) +} +func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Operation.Marshal(b, m, deterministic) +} +func (dst *Operation) XXX_Merge(src proto.Message) { + xxx_messageInfo_Operation.Merge(dst, src) +} +func (m *Operation) XXX_Size() int { + return xxx_messageInfo_Operation.Size(m) +} +func (m *Operation) XXX_DiscardUnknown() { + xxx_messageInfo_Operation.DiscardUnknown(m) +} + +var xxx_messageInfo_Operation proto.InternalMessageInfo func (m *Operation) GetTags() []string { if m != nil { @@ -389,17 +420,39 @@ func (m *Operation) GetSecurity() []*SecurityRequirement { // // TODO(ivucica): document fields type Info struct { - Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` - TermsOfService string `protobuf:"bytes,3,opt,name=terms_of_service,json=termsOfService" json:"terms_of_service,omitempty"` - Contact *Contact `protobuf:"bytes,4,opt,name=contact" json:"contact,omitempty"` - Version string `protobuf:"bytes,6,opt,name=version" json:"version,omitempty"` + Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + TermsOfService string `protobuf:"bytes,3,opt,name=terms_of_service,json=termsOfService" json:"terms_of_service,omitempty"` + Contact *Contact `protobuf:"bytes,4,opt,name=contact" json:"contact,omitempty"` + Version string `protobuf:"bytes,6,opt,name=version" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Info) Reset() { *m = Info{} } +func (m *Info) String() string { return proto.CompactTextString(m) } +func (*Info) ProtoMessage() {} +func (*Info) Descriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{2} +} +func (m *Info) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Info.Unmarshal(m, b) +} +func (m *Info) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Info.Marshal(b, m, deterministic) +} +func (dst *Info) XXX_Merge(src proto.Message) { + xxx_messageInfo_Info.Merge(dst, src) +} +func (m *Info) XXX_Size() int { + return xxx_messageInfo_Info.Size(m) +} +func (m *Info) XXX_DiscardUnknown() { + xxx_messageInfo_Info.DiscardUnknown(m) } -func (m *Info) Reset() { *m = Info{} } -func (m *Info) String() string { return proto.CompactTextString(m) } -func (*Info) ProtoMessage() {} -func (*Info) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +var xxx_messageInfo_Info proto.InternalMessageInfo func (m *Info) GetTitle() string { if m != nil { @@ -442,15 +495,37 @@ func (m *Info) GetVersion() string { // // TODO(ivucica): document fields type Contact struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` - Email string `protobuf:"bytes,3,opt,name=email" json:"email,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email" json:"email,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Contact) Reset() { *m = Contact{} } -func (m *Contact) String() string { return proto.CompactTextString(m) } -func (*Contact) ProtoMessage() {} -func (*Contact) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } +func (m *Contact) Reset() { *m = Contact{} } +func (m *Contact) String() string { return proto.CompactTextString(m) } +func (*Contact) ProtoMessage() {} +func (*Contact) Descriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{3} +} +func (m *Contact) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Contact.Unmarshal(m, b) +} +func (m *Contact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Contact.Marshal(b, m, deterministic) +} +func (dst *Contact) XXX_Merge(src proto.Message) { + xxx_messageInfo_Contact.Merge(dst, src) +} +func (m *Contact) XXX_Size() int { + return xxx_messageInfo_Contact.Size(m) +} +func (m *Contact) XXX_DiscardUnknown() { + xxx_messageInfo_Contact.DiscardUnknown(m) +} + +var xxx_messageInfo_Contact proto.InternalMessageInfo func (m *Contact) GetName() string { if m != nil { @@ -480,14 +555,36 @@ func (m *Contact) GetEmail() string { // // TODO(ivucica): document fields type ExternalDocumentation struct { - Description string `protobuf:"bytes,1,opt,name=description" json:"description,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` + Description string `protobuf:"bytes,1,opt,name=description" json:"description,omitempty"` + Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ExternalDocumentation) Reset() { *m = ExternalDocumentation{} } -func (m *ExternalDocumentation) String() string { return proto.CompactTextString(m) } -func (*ExternalDocumentation) ProtoMessage() {} -func (*ExternalDocumentation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } +func (m *ExternalDocumentation) Reset() { *m = ExternalDocumentation{} } +func (m *ExternalDocumentation) String() string { return proto.CompactTextString(m) } +func (*ExternalDocumentation) ProtoMessage() {} +func (*ExternalDocumentation) Descriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{4} +} +func (m *ExternalDocumentation) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ExternalDocumentation.Unmarshal(m, b) +} +func (m *ExternalDocumentation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ExternalDocumentation.Marshal(b, m, deterministic) +} +func (dst *ExternalDocumentation) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExternalDocumentation.Merge(dst, src) +} +func (m *ExternalDocumentation) XXX_Size() int { + return xxx_messageInfo_ExternalDocumentation.Size(m) +} +func (m *ExternalDocumentation) XXX_DiscardUnknown() { + xxx_messageInfo_ExternalDocumentation.DiscardUnknown(m) +} + +var xxx_messageInfo_ExternalDocumentation proto.InternalMessageInfo func (m *ExternalDocumentation) GetDescription() string { if m != nil { @@ -509,17 +606,39 @@ func (m *ExternalDocumentation) GetUrl() string { // // TODO(ivucica): document fields type Schema struct { - JsonSchema *JSONSchema `protobuf:"bytes,1,opt,name=json_schema,json=jsonSchema" json:"json_schema,omitempty"` - Discriminator string `protobuf:"bytes,2,opt,name=discriminator" json:"discriminator,omitempty"` - ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly" json:"read_only,omitempty"` - ExternalDocs *ExternalDocumentation `protobuf:"bytes,5,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` - Example *google_protobuf.Any `protobuf:"bytes,6,opt,name=example" json:"example,omitempty"` + JsonSchema *JSONSchema `protobuf:"bytes,1,opt,name=json_schema,json=jsonSchema" json:"json_schema,omitempty"` + Discriminator string `protobuf:"bytes,2,opt,name=discriminator" json:"discriminator,omitempty"` + ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly" json:"read_only,omitempty"` + ExternalDocs *ExternalDocumentation `protobuf:"bytes,5,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` + Example *any.Any `protobuf:"bytes,6,opt,name=example" json:"example,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Schema) Reset() { *m = Schema{} } +func (m *Schema) String() string { return proto.CompactTextString(m) } +func (*Schema) ProtoMessage() {} +func (*Schema) Descriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{5} +} +func (m *Schema) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Schema.Unmarshal(m, b) +} +func (m *Schema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Schema.Marshal(b, m, deterministic) +} +func (dst *Schema) XXX_Merge(src proto.Message) { + xxx_messageInfo_Schema.Merge(dst, src) +} +func (m *Schema) XXX_Size() int { + return xxx_messageInfo_Schema.Size(m) +} +func (m *Schema) XXX_DiscardUnknown() { + xxx_messageInfo_Schema.DiscardUnknown(m) } -func (m *Schema) Reset() { *m = Schema{} } -func (m *Schema) String() string { return proto.CompactTextString(m) } -func (*Schema) ProtoMessage() {} -func (*Schema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } +var xxx_messageInfo_Schema proto.InternalMessageInfo func (m *Schema) GetJsonSchema() *JSONSchema { if m != nil { @@ -549,7 +668,7 @@ func (m *Schema) GetExternalDocs() *ExternalDocumentation { return nil } -func (m *Schema) GetExample() *google_protobuf.Any { +func (m *Schema) GetExample() *any.Any { if m != nil { return m.Example } @@ -586,14 +705,36 @@ type JSONSchema struct { MinProperties uint64 `protobuf:"varint,25,opt,name=min_properties,json=minProperties" json:"min_properties,omitempty"` Required []string `protobuf:"bytes,26,rep,name=required" json:"required,omitempty"` // Items in 'array' must be unique. - Array []string `protobuf:"bytes,34,rep,name=array" json:"array,omitempty"` - Type []JSONSchema_JSONSchemaSimpleTypes `protobuf:"varint,35,rep,packed,name=type,enum=grpc.gateway.protoc_gen_swagger.options.JSONSchema_JSONSchemaSimpleTypes" json:"type,omitempty"` + Array []string `protobuf:"bytes,34,rep,name=array" json:"array,omitempty"` + Type []JSONSchema_JSONSchemaSimpleTypes `protobuf:"varint,35,rep,packed,name=type,enum=grpc.gateway.protoc_gen_swagger.options.JSONSchema_JSONSchemaSimpleTypes" json:"type,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *JSONSchema) Reset() { *m = JSONSchema{} } -func (m *JSONSchema) String() string { return proto.CompactTextString(m) } -func (*JSONSchema) ProtoMessage() {} -func (*JSONSchema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } +func (m *JSONSchema) Reset() { *m = JSONSchema{} } +func (m *JSONSchema) String() string { return proto.CompactTextString(m) } +func (*JSONSchema) ProtoMessage() {} +func (*JSONSchema) Descriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{6} +} +func (m *JSONSchema) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_JSONSchema.Unmarshal(m, b) +} +func (m *JSONSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_JSONSchema.Marshal(b, m, deterministic) +} +func (dst *JSONSchema) XXX_Merge(src proto.Message) { + xxx_messageInfo_JSONSchema.Merge(dst, src) +} +func (m *JSONSchema) XXX_Size() int { + return xxx_messageInfo_JSONSchema.Size(m) +} +func (m *JSONSchema) XXX_DiscardUnknown() { + xxx_messageInfo_JSONSchema.DiscardUnknown(m) +} + +var xxx_messageInfo_JSONSchema proto.InternalMessageInfo func (m *JSONSchema) GetTitle() string { if m != nil { @@ -736,14 +877,36 @@ func (m *JSONSchema) GetType() []JSONSchema_JSONSchemaSimpleTypes { type Tag struct { // TODO(ivucica): Description should be extracted from comments on the proto // service object. - Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` - ExternalDocs *ExternalDocumentation `protobuf:"bytes,3,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + ExternalDocs *ExternalDocumentation `protobuf:"bytes,3,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Tag) Reset() { *m = Tag{} } -func (m *Tag) String() string { return proto.CompactTextString(m) } -func (*Tag) ProtoMessage() {} -func (*Tag) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } +func (m *Tag) Reset() { *m = Tag{} } +func (m *Tag) String() string { return proto.CompactTextString(m) } +func (*Tag) ProtoMessage() {} +func (*Tag) Descriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{7} +} +func (m *Tag) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Tag.Unmarshal(m, b) +} +func (m *Tag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Tag.Marshal(b, m, deterministic) +} +func (dst *Tag) XXX_Merge(src proto.Message) { + xxx_messageInfo_Tag.Merge(dst, src) +} +func (m *Tag) XXX_Size() int { + return xxx_messageInfo_Tag.Size(m) +} +func (m *Tag) XXX_DiscardUnknown() { + xxx_messageInfo_Tag.DiscardUnknown(m) +} + +var xxx_messageInfo_Tag proto.InternalMessageInfo func (m *Tag) GetDescription() string { if m != nil { @@ -769,13 +932,35 @@ func (m *Tag) GetExternalDocs() *ExternalDocumentation { // and only serves to provide the relevant details for each scheme. type SecurityDefinitions struct { // A single security scheme definition, mapping a "name" to the scheme it defines. - Security map[string]*SecurityScheme `protobuf:"bytes,1,rep,name=security" json:"security,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Security map[string]*SecurityScheme `protobuf:"bytes,1,rep,name=security" json:"security,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SecurityDefinitions) Reset() { *m = SecurityDefinitions{} } +func (m *SecurityDefinitions) String() string { return proto.CompactTextString(m) } +func (*SecurityDefinitions) ProtoMessage() {} +func (*SecurityDefinitions) Descriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{8} +} +func (m *SecurityDefinitions) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SecurityDefinitions.Unmarshal(m, b) +} +func (m *SecurityDefinitions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SecurityDefinitions.Marshal(b, m, deterministic) +} +func (dst *SecurityDefinitions) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecurityDefinitions.Merge(dst, src) +} +func (m *SecurityDefinitions) XXX_Size() int { + return xxx_messageInfo_SecurityDefinitions.Size(m) +} +func (m *SecurityDefinitions) XXX_DiscardUnknown() { + xxx_messageInfo_SecurityDefinitions.DiscardUnknown(m) } -func (m *SecurityDefinitions) Reset() { *m = SecurityDefinitions{} } -func (m *SecurityDefinitions) String() string { return proto.CompactTextString(m) } -func (*SecurityDefinitions) ProtoMessage() {} -func (*SecurityDefinitions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } +var xxx_messageInfo_SecurityDefinitions proto.InternalMessageInfo func (m *SecurityDefinitions) GetSecurity() map[string]*SecurityScheme { if m != nil { @@ -825,13 +1010,35 @@ type SecurityScheme struct { // Required. The available scopes for the OAuth2 security scheme. // // Valid for oauth2. - Scopes *Scopes `protobuf:"bytes,8,opt,name=scopes" json:"scopes,omitempty"` + Scopes *Scopes `protobuf:"bytes,8,opt,name=scopes" json:"scopes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SecurityScheme) Reset() { *m = SecurityScheme{} } +func (m *SecurityScheme) String() string { return proto.CompactTextString(m) } +func (*SecurityScheme) ProtoMessage() {} +func (*SecurityScheme) Descriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{9} +} +func (m *SecurityScheme) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SecurityScheme.Unmarshal(m, b) +} +func (m *SecurityScheme) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SecurityScheme.Marshal(b, m, deterministic) +} +func (dst *SecurityScheme) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecurityScheme.Merge(dst, src) +} +func (m *SecurityScheme) XXX_Size() int { + return xxx_messageInfo_SecurityScheme.Size(m) +} +func (m *SecurityScheme) XXX_DiscardUnknown() { + xxx_messageInfo_SecurityScheme.DiscardUnknown(m) } -func (m *SecurityScheme) Reset() { *m = SecurityScheme{} } -func (m *SecurityScheme) String() string { return proto.CompactTextString(m) } -func (*SecurityScheme) ProtoMessage() {} -func (*SecurityScheme) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } +var xxx_messageInfo_SecurityScheme proto.InternalMessageInfo func (m *SecurityScheme) GetType() SecurityScheme_Type { if m != nil { @@ -905,13 +1112,35 @@ type SecurityRequirement struct { // the Security Definitions. If the security scheme is of type "oauth2", // then the value is a list of scope names required for the execution. // For other security scheme types, the array MUST be empty. - SecurityRequirement map[string]*SecurityRequirement_SecurityRequirementValue `protobuf:"bytes,1,rep,name=security_requirement,json=securityRequirement" json:"security_requirement,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + SecurityRequirement map[string]*SecurityRequirement_SecurityRequirementValue `protobuf:"bytes,1,rep,name=security_requirement,json=securityRequirement" json:"security_requirement,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *SecurityRequirement) Reset() { *m = SecurityRequirement{} } -func (m *SecurityRequirement) String() string { return proto.CompactTextString(m) } -func (*SecurityRequirement) ProtoMessage() {} -func (*SecurityRequirement) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } +func (m *SecurityRequirement) Reset() { *m = SecurityRequirement{} } +func (m *SecurityRequirement) String() string { return proto.CompactTextString(m) } +func (*SecurityRequirement) ProtoMessage() {} +func (*SecurityRequirement) Descriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{10} +} +func (m *SecurityRequirement) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SecurityRequirement.Unmarshal(m, b) +} +func (m *SecurityRequirement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SecurityRequirement.Marshal(b, m, deterministic) +} +func (dst *SecurityRequirement) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecurityRequirement.Merge(dst, src) +} +func (m *SecurityRequirement) XXX_Size() int { + return xxx_messageInfo_SecurityRequirement.Size(m) +} +func (m *SecurityRequirement) XXX_DiscardUnknown() { + xxx_messageInfo_SecurityRequirement.DiscardUnknown(m) +} + +var xxx_messageInfo_SecurityRequirement proto.InternalMessageInfo func (m *SecurityRequirement) GetSecurityRequirement() map[string]*SecurityRequirement_SecurityRequirementValue { if m != nil { @@ -924,7 +1153,10 @@ func (m *SecurityRequirement) GetSecurityRequirement() map[string]*SecurityRequi // scope names required for the execution. For other security scheme types, // the array MUST be empty. type SecurityRequirement_SecurityRequirementValue struct { - Scope []string `protobuf:"bytes,1,rep,name=scope" json:"scope,omitempty"` + Scope []string `protobuf:"bytes,1,rep,name=scope" json:"scope,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *SecurityRequirement_SecurityRequirementValue) Reset() { @@ -935,8 +1167,25 @@ func (m *SecurityRequirement_SecurityRequirementValue) String() string { } func (*SecurityRequirement_SecurityRequirementValue) ProtoMessage() {} func (*SecurityRequirement_SecurityRequirementValue) Descriptor() ([]byte, []int) { - return fileDescriptor0, []int{10, 0} + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{10, 0} +} +func (m *SecurityRequirement_SecurityRequirementValue) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SecurityRequirement_SecurityRequirementValue.Unmarshal(m, b) +} +func (m *SecurityRequirement_SecurityRequirementValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SecurityRequirement_SecurityRequirementValue.Marshal(b, m, deterministic) +} +func (dst *SecurityRequirement_SecurityRequirementValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecurityRequirement_SecurityRequirementValue.Merge(dst, src) } +func (m *SecurityRequirement_SecurityRequirementValue) XXX_Size() int { + return xxx_messageInfo_SecurityRequirement_SecurityRequirementValue.Size(m) +} +func (m *SecurityRequirement_SecurityRequirementValue) XXX_DiscardUnknown() { + xxx_messageInfo_SecurityRequirement_SecurityRequirementValue.DiscardUnknown(m) +} + +var xxx_messageInfo_SecurityRequirement_SecurityRequirementValue proto.InternalMessageInfo func (m *SecurityRequirement_SecurityRequirementValue) GetScope() []string { if m != nil { @@ -953,13 +1202,35 @@ func (m *SecurityRequirement_SecurityRequirementValue) GetScope() []string { type Scopes struct { // Maps between a name of a scope to a short description of it (as the value // of the property). - Scope map[string]string `protobuf:"bytes,1,rep,name=scope" json:"scope,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Scope map[string]string `protobuf:"bytes,1,rep,name=scope" json:"scope,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Scopes) Reset() { *m = Scopes{} } +func (m *Scopes) String() string { return proto.CompactTextString(m) } +func (*Scopes) ProtoMessage() {} +func (*Scopes) Descriptor() ([]byte, []int) { + return fileDescriptor_openapiv2_4346354ad6fc20e0, []int{11} +} +func (m *Scopes) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Scopes.Unmarshal(m, b) +} +func (m *Scopes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Scopes.Marshal(b, m, deterministic) +} +func (dst *Scopes) XXX_Merge(src proto.Message) { + xxx_messageInfo_Scopes.Merge(dst, src) +} +func (m *Scopes) XXX_Size() int { + return xxx_messageInfo_Scopes.Size(m) +} +func (m *Scopes) XXX_DiscardUnknown() { + xxx_messageInfo_Scopes.DiscardUnknown(m) } -func (m *Scopes) Reset() { *m = Scopes{} } -func (m *Scopes) String() string { return proto.CompactTextString(m) } -func (*Scopes) ProtoMessage() {} -func (*Scopes) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } +var xxx_messageInfo_Scopes proto.InternalMessageInfo func (m *Scopes) GetScope() map[string]string { if m != nil { @@ -978,10 +1249,13 @@ func init() { proto.RegisterType((*JSONSchema)(nil), "grpc.gateway.protoc_gen_swagger.options.JSONSchema") proto.RegisterType((*Tag)(nil), "grpc.gateway.protoc_gen_swagger.options.Tag") proto.RegisterType((*SecurityDefinitions)(nil), "grpc.gateway.protoc_gen_swagger.options.SecurityDefinitions") + proto.RegisterMapType((map[string]*SecurityScheme)(nil), "grpc.gateway.protoc_gen_swagger.options.SecurityDefinitions.SecurityEntry") proto.RegisterType((*SecurityScheme)(nil), "grpc.gateway.protoc_gen_swagger.options.SecurityScheme") proto.RegisterType((*SecurityRequirement)(nil), "grpc.gateway.protoc_gen_swagger.options.SecurityRequirement") + proto.RegisterMapType((map[string]*SecurityRequirement_SecurityRequirementValue)(nil), "grpc.gateway.protoc_gen_swagger.options.SecurityRequirement.SecurityRequirementEntry") proto.RegisterType((*SecurityRequirement_SecurityRequirementValue)(nil), "grpc.gateway.protoc_gen_swagger.options.SecurityRequirement.SecurityRequirementValue") proto.RegisterType((*Scopes)(nil), "grpc.gateway.protoc_gen_swagger.options.Scopes") + proto.RegisterMapType((map[string]string)(nil), "grpc.gateway.protoc_gen_swagger.options.Scopes.ScopeEntry") proto.RegisterEnum("grpc.gateway.protoc_gen_swagger.options.Swagger_SwaggerScheme", Swagger_SwaggerScheme_name, Swagger_SwaggerScheme_value) proto.RegisterEnum("grpc.gateway.protoc_gen_swagger.options.JSONSchema_JSONSchemaSimpleTypes", JSONSchema_JSONSchemaSimpleTypes_name, JSONSchema_JSONSchemaSimpleTypes_value) proto.RegisterEnum("grpc.gateway.protoc_gen_swagger.options.SecurityScheme_Type", SecurityScheme_Type_name, SecurityScheme_Type_value) @@ -989,9 +1263,11 @@ func init() { proto.RegisterEnum("grpc.gateway.protoc_gen_swagger.options.SecurityScheme_Flow", SecurityScheme_Flow_name, SecurityScheme_Flow_value) } -func init() { proto.RegisterFile("protoc-gen-swagger/options/openapiv2.proto", fileDescriptor0) } +func init() { + proto.RegisterFile("protoc-gen-swagger/options/openapiv2.proto", fileDescriptor_openapiv2_4346354ad6fc20e0) +} -var fileDescriptor0 = []byte{ +var fileDescriptor_openapiv2_4346354ad6fc20e0 = []byte{ // 1664 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x5b, 0x73, 0xdb, 0xc6, 0x15, 0x0e, 0xc8, 0x25, 0x09, 0x1e, 0x4a, 0xcc, 0x7a, 0x2d, 0xb7, 0x88, 0x12, 0xbb, 0x0a, 0x9a, diff --git a/runtime/internal/stream_chunk.pb.go b/runtime/internal/stream_chunk.pb.go index 82af3a616be..a06c722c167 100644 --- a/runtime/internal/stream_chunk.pb.go +++ b/runtime/internal/stream_chunk.pb.go @@ -1,21 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: runtime/internal/stream_chunk.proto -/* -Package internal is a generated protocol buffer package. - -It is generated from these files: - runtime/internal/stream_chunk.proto - -It has these top-level messages: - StreamError -*/ package internal import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import google_protobuf "github.com/golang/protobuf/ptypes/any" +import any "github.com/golang/protobuf/ptypes/any" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -31,17 +22,39 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // StreamError is a response type which is returned when // streaming rpc returns an error. type StreamError struct { - GrpcCode int32 `protobuf:"varint,1,opt,name=grpc_code,json=grpcCode" json:"grpc_code,omitempty"` - HttpCode int32 `protobuf:"varint,2,opt,name=http_code,json=httpCode" json:"http_code,omitempty"` - Message string `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"` - HttpStatus string `protobuf:"bytes,4,opt,name=http_status,json=httpStatus" json:"http_status,omitempty"` - Details []*google_protobuf.Any `protobuf:"bytes,5,rep,name=details" json:"details,omitempty"` + GrpcCode int32 `protobuf:"varint,1,opt,name=grpc_code,json=grpcCode" json:"grpc_code,omitempty"` + HttpCode int32 `protobuf:"varint,2,opt,name=http_code,json=httpCode" json:"http_code,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"` + HttpStatus string `protobuf:"bytes,4,opt,name=http_status,json=httpStatus" json:"http_status,omitempty"` + Details []*any.Any `protobuf:"bytes,5,rep,name=details" json:"details,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *StreamError) Reset() { *m = StreamError{} } -func (m *StreamError) String() string { return proto.CompactTextString(m) } -func (*StreamError) ProtoMessage() {} -func (*StreamError) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *StreamError) Reset() { *m = StreamError{} } +func (m *StreamError) String() string { return proto.CompactTextString(m) } +func (*StreamError) ProtoMessage() {} +func (*StreamError) Descriptor() ([]byte, []int) { + return fileDescriptor_stream_chunk_6adb10b40700458b, []int{0} +} +func (m *StreamError) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StreamError.Unmarshal(m, b) +} +func (m *StreamError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StreamError.Marshal(b, m, deterministic) +} +func (dst *StreamError) XXX_Merge(src proto.Message) { + xxx_messageInfo_StreamError.Merge(dst, src) +} +func (m *StreamError) XXX_Size() int { + return xxx_messageInfo_StreamError.Size(m) +} +func (m *StreamError) XXX_DiscardUnknown() { + xxx_messageInfo_StreamError.DiscardUnknown(m) +} + +var xxx_messageInfo_StreamError proto.InternalMessageInfo func (m *StreamError) GetGrpcCode() int32 { if m != nil { @@ -71,7 +84,7 @@ func (m *StreamError) GetHttpStatus() string { return "" } -func (m *StreamError) GetDetails() []*google_protobuf.Any { +func (m *StreamError) GetDetails() []*any.Any { if m != nil { return m.Details } @@ -82,9 +95,11 @@ func init() { proto.RegisterType((*StreamError)(nil), "grpc.gateway.runtime.StreamError") } -func init() { proto.RegisterFile("runtime/internal/stream_chunk.proto", fileDescriptor0) } +func init() { + proto.RegisterFile("runtime/internal/stream_chunk.proto", fileDescriptor_stream_chunk_6adb10b40700458b) +} -var fileDescriptor0 = []byte{ +var fileDescriptor_stream_chunk_6adb10b40700458b = []byte{ // 226 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x90, 0xc1, 0x4e, 0x84, 0x30, 0x10, 0x86, 0x83, 0xeb, 0xba, 0xbb, 0xc3, 0x8d, 0xec, 0xa1, 0xea, 0x41, 0xa2, 0x17, 0x4e, 0x25, diff --git a/runtime/marshal_proto_test.go b/runtime/marshal_proto_test.go index 535f3991d9d..1da30b8a8d6 100644 --- a/runtime/marshal_proto_test.go +++ b/runtime/marshal_proto_test.go @@ -1,10 +1,10 @@ package runtime_test import ( - "reflect" + "bytes" "testing" - "bytes" + "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes/timestamp" "github.com/grpc-ecosystem/grpc-gateway/examples/proto/examplepb" "github.com/grpc-ecosystem/grpc-gateway/runtime" @@ -51,7 +51,7 @@ func TestProtoMarshalUnmarshal(t *testing.T) { t.Fatalf("Unmarshalling returned error: %s", err.Error()) } - if !reflect.DeepEqual(unmarshalled, message) { + if !proto.Equal(unmarshalled, message) { t.Errorf( "Unmarshalled didn't match original message: (original = %v) != (unmarshalled = %v)", unmarshalled, @@ -81,7 +81,7 @@ func TestProtoEncoderDecodert(t *testing.T) { t.Fatalf("Unmarshalling returned error: %s", err.Error()) } - if !reflect.DeepEqual(unencoded, message) { + if !proto.Equal(unencoded, message) { t.Errorf( "Unencoded didn't match original message: (original = %v) != (unencoded = %v)", unencoded, diff --git a/runtime/query_test.go b/runtime/query_test.go index 969a8ca1263..904be49920a 100644 --- a/runtime/query_test.go +++ b/runtime/query_test.go @@ -26,7 +26,7 @@ func TestPopulateParameters(t *testing.T) { } fieldmaskStr := "float_value,double_value" - fieldmaskPb := &field_mask.FieldMask{[]string{"float_value", "double_value"}} + fieldmaskPb := &field_mask.FieldMask{Paths: []string{"float_value", "double_value"}} for _, spec := range []struct { values url.Values @@ -95,15 +95,15 @@ func TestPopulateParameters(t *testing.T) { RepeatedEnum: []EnumValue{EnumValue_Y, EnumValue_Z, EnumValue_X}, TimestampValue: timePb, FieldMaskValue: fieldmaskPb, - WrapperFloatValue: &wrappers.FloatValue{1.5}, - WrapperDoubleValue: &wrappers.DoubleValue{2.5}, - WrapperInt64Value: &wrappers.Int64Value{-1}, - WrapperInt32Value: &wrappers.Int32Value{-2}, - WrapperUInt64Value: &wrappers.UInt64Value{3}, - WrapperUInt32Value: &wrappers.UInt32Value{4}, - WrapperBoolValue: &wrappers.BoolValue{true}, - WrapperStringValue: &wrappers.StringValue{"str"}, - WrapperBytesValue: &wrappers.BytesValue{[]byte("bytes")}, + WrapperFloatValue: &wrappers.FloatValue{Value: 1.5}, + WrapperDoubleValue: &wrappers.DoubleValue{Value: 2.5}, + WrapperInt64Value: &wrappers.Int64Value{Value: -1}, + WrapperInt32Value: &wrappers.Int32Value{Value: -2}, + WrapperUInt64Value: &wrappers.UInt64Value{Value: 3}, + WrapperUInt32Value: &wrappers.UInt32Value{Value: 4}, + WrapperBoolValue: &wrappers.BoolValue{Value: true}, + WrapperStringValue: &wrappers.StringValue{Value: "str"}, + WrapperBytesValue: &wrappers.BytesValue{Value: []byte("bytes")}, MapValue: map[string]string{ "key": "value", "second": "bar", @@ -169,15 +169,15 @@ func TestPopulateParameters(t *testing.T) { RepeatedEnum: []EnumValue{EnumValue_Y, EnumValue_Z, EnumValue_X}, TimestampValue: timePb, FieldMaskValue: fieldmaskPb, - WrapperFloatValue: &wrappers.FloatValue{1.5}, - WrapperDoubleValue: &wrappers.DoubleValue{2.5}, - WrapperInt64Value: &wrappers.Int64Value{-1}, - WrapperInt32Value: &wrappers.Int32Value{-2}, - WrapperUInt64Value: &wrappers.UInt64Value{3}, - WrapperUInt32Value: &wrappers.UInt32Value{4}, - WrapperBoolValue: &wrappers.BoolValue{true}, - WrapperStringValue: &wrappers.StringValue{"str"}, - WrapperBytesValue: &wrappers.BytesValue{[]byte("bytes")}, + WrapperFloatValue: &wrappers.FloatValue{Value: 1.5}, + WrapperDoubleValue: &wrappers.DoubleValue{Value: 2.5}, + WrapperInt64Value: &wrappers.Int64Value{Value: -1}, + WrapperInt32Value: &wrappers.Int32Value{Value: -2}, + WrapperUInt64Value: &wrappers.UInt64Value{Value: 3}, + WrapperUInt32Value: &wrappers.UInt32Value{Value: 4}, + WrapperBoolValue: &wrappers.BoolValue{Value: true}, + WrapperStringValue: &wrappers.StringValue{Value: "str"}, + WrapperBytesValue: &wrappers.BytesValue{Value: []byte("bytes")}, }, }, {