Codebase list golang-github-go-kit-kit / 419745d
update protobuf Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com> Mark Sagi-Kazar 2 years ago
10 changed file(s) with 427 addition(s) and 241 deletion(s). Raw diff Collapse all Expand all
1919 github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8 // indirect
2020 github.com/go-logfmt/logfmt v0.5.0
2121 github.com/go-stack/stack v1.8.0
22 github.com/golang/protobuf v1.5.2
2322 github.com/google/btree v1.0.0 // indirect
2423 github.com/hashicorp/consul/api v1.3.0
2524 github.com/hashicorp/golang-lru v0.5.1 // indirect
4847 golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1
4948 golang.org/x/tools v0.1.2
5049 google.golang.org/grpc v1.38.0
50 google.golang.org/protobuf v1.26.0
5151 gopkg.in/gcfg.v1 v1.2.3 // indirect
5252 gopkg.in/warnings.v0 v0.1.2 // indirect
5353 )
00 package pb
11
2 //go:generate protoc test.proto --go_out=plugins=grpc:.
2 //go:generate protoc test.proto --go_out=. --go-grpc_out=. --go_opt=Mtest.proto=github.com/go-kit/kit/transport/grpc/_grpc_test/pb --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go-grpc_opt=Mtest.proto=github.com/go-kit/kit/transport/grpc/_grpc_test/pb
00 // Code generated by protoc-gen-go. DO NOT EDIT.
1 // versions:
2 // protoc-gen-go v1.26.0
3 // protoc v3.16.0
14 // source: test.proto
25
36 package pb
47
58 import (
6 context "context"
7 fmt "fmt"
8 proto "github.com/golang/protobuf/proto"
9 grpc "google.golang.org/grpc"
10 math "math"
9 protoreflect "google.golang.org/protobuf/reflect/protoreflect"
10 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
11 reflect "reflect"
12 sync "sync"
1113 )
1214
13 // Reference imports to suppress errors if they are not otherwise used.
14 var _ = proto.Marshal
15 var _ = fmt.Errorf
16 var _ = math.Inf
17
18 // This is a compile-time assertion to ensure that this generated file
19 // is compatible with the proto package it is being compiled against.
20 // A compilation error at this line likely means your copy of the
21 // proto package needs to be updated.
22 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
15 const (
16 // Verify that this generated code is sufficiently up-to-date.
17 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
18 // Verify that runtime/protoimpl is sufficiently up-to-date.
19 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
20 )
2321
2422 type TestRequest struct {
25 A string `protobuf:"bytes,1,opt,name=a,proto3" json:"a,omitempty"`
26 B int64 `protobuf:"varint,2,opt,name=b,proto3" json:"b,omitempty"`
27 XXX_NoUnkeyedLiteral struct{} `json:"-"`
28 XXX_unrecognized []byte `json:"-"`
29 XXX_sizecache int32 `json:"-"`
30 }
31
32 func (m *TestRequest) Reset() { *m = TestRequest{} }
33 func (m *TestRequest) String() string { return proto.CompactTextString(m) }
34 func (*TestRequest) ProtoMessage() {}
23 state protoimpl.MessageState
24 sizeCache protoimpl.SizeCache
25 unknownFields protoimpl.UnknownFields
26
27 A string `protobuf:"bytes,1,opt,name=a,proto3" json:"a,omitempty"`
28 B int64 `protobuf:"varint,2,opt,name=b,proto3" json:"b,omitempty"`
29 }
30
31 func (x *TestRequest) Reset() {
32 *x = TestRequest{}
33 if protoimpl.UnsafeEnabled {
34 mi := &file_test_proto_msgTypes[0]
35 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
36 ms.StoreMessageInfo(mi)
37 }
38 }
39
40 func (x *TestRequest) String() string {
41 return protoimpl.X.MessageStringOf(x)
42 }
43
44 func (*TestRequest) ProtoMessage() {}
45
46 func (x *TestRequest) ProtoReflect() protoreflect.Message {
47 mi := &file_test_proto_msgTypes[0]
48 if protoimpl.UnsafeEnabled && x != nil {
49 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
50 if ms.LoadMessageInfo() == nil {
51 ms.StoreMessageInfo(mi)
52 }
53 return ms
54 }
55 return mi.MessageOf(x)
56 }
57
58 // Deprecated: Use TestRequest.ProtoReflect.Descriptor instead.
3559 func (*TestRequest) Descriptor() ([]byte, []int) {
36 return fileDescriptor_c161fcfdc0c3ff1e, []int{0}
37 }
38
39 func (m *TestRequest) XXX_Unmarshal(b []byte) error {
40 return xxx_messageInfo_TestRequest.Unmarshal(m, b)
41 }
42 func (m *TestRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
43 return xxx_messageInfo_TestRequest.Marshal(b, m, deterministic)
44 }
45 func (m *TestRequest) XXX_Merge(src proto.Message) {
46 xxx_messageInfo_TestRequest.Merge(m, src)
47 }
48 func (m *TestRequest) XXX_Size() int {
49 return xxx_messageInfo_TestRequest.Size(m)
50 }
51 func (m *TestRequest) XXX_DiscardUnknown() {
52 xxx_messageInfo_TestRequest.DiscardUnknown(m)
53 }
54
55 var xxx_messageInfo_TestRequest proto.InternalMessageInfo
56
57 func (m *TestRequest) GetA() string {
58 if m != nil {
59 return m.A
60 return file_test_proto_rawDescGZIP(), []int{0}
61 }
62
63 func (x *TestRequest) GetA() string {
64 if x != nil {
65 return x.A
6066 }
6167 return ""
6268 }
6369
64 func (m *TestRequest) GetB() int64 {
65 if m != nil {
66 return m.B
70 func (x *TestRequest) GetB() int64 {
71 if x != nil {
72 return x.B
6773 }
6874 return 0
6975 }
7076
7177 type TestResponse struct {
72 V string `protobuf:"bytes,1,opt,name=v,proto3" json:"v,omitempty"`
73 XXX_NoUnkeyedLiteral struct{} `json:"-"`
74 XXX_unrecognized []byte `json:"-"`
75 XXX_sizecache int32 `json:"-"`
76 }
77
78 func (m *TestResponse) Reset() { *m = TestResponse{} }
79 func (m *TestResponse) String() string { return proto.CompactTextString(m) }
80 func (*TestResponse) ProtoMessage() {}
78 state protoimpl.MessageState
79 sizeCache protoimpl.SizeCache
80 unknownFields protoimpl.UnknownFields
81
82 V string `protobuf:"bytes,1,opt,name=v,proto3" json:"v,omitempty"`
83 }
84
85 func (x *TestResponse) Reset() {
86 *x = TestResponse{}
87 if protoimpl.UnsafeEnabled {
88 mi := &file_test_proto_msgTypes[1]
89 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
90 ms.StoreMessageInfo(mi)
91 }
92 }
93
94 func (x *TestResponse) String() string {
95 return protoimpl.X.MessageStringOf(x)
96 }
97
98 func (*TestResponse) ProtoMessage() {}
99
100 func (x *TestResponse) ProtoReflect() protoreflect.Message {
101 mi := &file_test_proto_msgTypes[1]
102 if protoimpl.UnsafeEnabled && x != nil {
103 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
104 if ms.LoadMessageInfo() == nil {
105 ms.StoreMessageInfo(mi)
106 }
107 return ms
108 }
109 return mi.MessageOf(x)
110 }
111
112 // Deprecated: Use TestResponse.ProtoReflect.Descriptor instead.
81113 func (*TestResponse) Descriptor() ([]byte, []int) {
82 return fileDescriptor_c161fcfdc0c3ff1e, []int{1}
83 }
84
85 func (m *TestResponse) XXX_Unmarshal(b []byte) error {
86 return xxx_messageInfo_TestResponse.Unmarshal(m, b)
87 }
88 func (m *TestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
89 return xxx_messageInfo_TestResponse.Marshal(b, m, deterministic)
90 }
91 func (m *TestResponse) XXX_Merge(src proto.Message) {
92 xxx_messageInfo_TestResponse.Merge(m, src)
93 }
94 func (m *TestResponse) XXX_Size() int {
95 return xxx_messageInfo_TestResponse.Size(m)
96 }
97 func (m *TestResponse) XXX_DiscardUnknown() {
98 xxx_messageInfo_TestResponse.DiscardUnknown(m)
99 }
100
101 var xxx_messageInfo_TestResponse proto.InternalMessageInfo
102
103 func (m *TestResponse) GetV() string {
104 if m != nil {
105 return m.V
114 return file_test_proto_rawDescGZIP(), []int{1}
115 }
116
117 func (x *TestResponse) GetV() string {
118 if x != nil {
119 return x.V
106120 }
107121 return ""
108122 }
109123
110 func init() {
111 proto.RegisterType((*TestRequest)(nil), "pb.TestRequest")
112 proto.RegisterType((*TestResponse)(nil), "pb.TestResponse")
113 }
114
115 func init() { proto.RegisterFile("test.proto", fileDescriptor_c161fcfdc0c3ff1e) }
116
117 var fileDescriptor_c161fcfdc0c3ff1e = []byte{
118 // 129 bytes of a gzipped FileDescriptorProto
119 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0x49, 0x2d, 0x2e,
120 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2a, 0x48, 0x52, 0xd2, 0xe4, 0xe2, 0x0e, 0x49,
121 0x2d, 0x2e, 0x09, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0xe2, 0xe1, 0x62, 0x4c, 0x94, 0x60,
122 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x62, 0x4c, 0x04, 0xf1, 0x92, 0x24, 0x98, 0x14, 0x18, 0x35, 0x98,
123 0x83, 0x18, 0x93, 0x94, 0x64, 0xb8, 0x78, 0x20, 0x4a, 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x41,
124 0xb2, 0x65, 0x30, 0xb5, 0x65, 0x46, 0xc6, 0x5c, 0x2c, 0x20, 0x59, 0x21, 0x6d, 0x28, 0xcd, 0xaf,
125 0x57, 0x90, 0xa4, 0x87, 0x64, 0xb4, 0x94, 0x00, 0x42, 0x00, 0x62, 0x80, 0x12, 0x43, 0x12, 0x1b,
126 0xd8, 0x21, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x49, 0xfc, 0xd8, 0xf1, 0x96, 0x00, 0x00,
127 0x00,
128 }
129
130 // Reference imports to suppress errors if they are not otherwise used.
131 var _ context.Context
132 var _ grpc.ClientConn
133
134 // This is a compile-time assertion to ensure that this generated file
135 // is compatible with the grpc package it is being compiled against.
136 const _ = grpc.SupportPackageIsVersion4
137
138 // TestClient is the client API for Test service.
139 //
140 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
141 type TestClient interface {
142 Test(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error)
143 }
144
145 type testClient struct {
146 cc *grpc.ClientConn
147 }
148
149 func NewTestClient(cc *grpc.ClientConn) TestClient {
150 return &testClient{cc}
151 }
152
153 func (c *testClient) Test(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error) {
154 out := new(TestResponse)
155 err := c.cc.Invoke(ctx, "/pb.Test/Test", in, out, opts...)
156 if err != nil {
157 return nil, err
158 }
159 return out, nil
160 }
161
162 // TestServer is the server API for Test service.
163 type TestServer interface {
164 Test(context.Context, *TestRequest) (*TestResponse, error)
165 }
166
167 func RegisterTestServer(s *grpc.Server, srv TestServer) {
168 s.RegisterService(&_Test_serviceDesc, srv)
169 }
170
171 func _Test_Test_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
172 in := new(TestRequest)
173 if err := dec(in); err != nil {
174 return nil, err
175 }
176 if interceptor == nil {
177 return srv.(TestServer).Test(ctx, in)
178 }
179 info := &grpc.UnaryServerInfo{
180 Server: srv,
181 FullMethod: "/pb.Test/Test",
182 }
183 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
184 return srv.(TestServer).Test(ctx, req.(*TestRequest))
185 }
186 return interceptor(ctx, in, info, handler)
187 }
188
189 var _Test_serviceDesc = grpc.ServiceDesc{
190 ServiceName: "pb.Test",
191 HandlerType: (*TestServer)(nil),
192 Methods: []grpc.MethodDesc{
193 {
194 MethodName: "Test",
195 Handler: _Test_Test_Handler,
124 var File_test_proto protoreflect.FileDescriptor
125
126 var file_test_proto_rawDesc = []byte{
127 0x0a, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62,
128 0x22, 0x29, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
129 0x0c, 0x0a, 0x01, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x61, 0x12, 0x0c, 0x0a,
130 0x01, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x01, 0x62, 0x22, 0x1c, 0x0a, 0x0c, 0x54,
131 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x76,
132 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x76, 0x32, 0x33, 0x0a, 0x04, 0x54, 0x65, 0x73,
133 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x54,
134 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x2e,
135 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x62, 0x06,
136 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
137 }
138
139 var (
140 file_test_proto_rawDescOnce sync.Once
141 file_test_proto_rawDescData = file_test_proto_rawDesc
142 )
143
144 func file_test_proto_rawDescGZIP() []byte {
145 file_test_proto_rawDescOnce.Do(func() {
146 file_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_test_proto_rawDescData)
147 })
148 return file_test_proto_rawDescData
149 }
150
151 var file_test_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
152 var file_test_proto_goTypes = []interface{}{
153 (*TestRequest)(nil), // 0: pb.TestRequest
154 (*TestResponse)(nil), // 1: pb.TestResponse
155 }
156 var file_test_proto_depIdxs = []int32{
157 0, // 0: pb.Test.Test:input_type -> pb.TestRequest
158 1, // 1: pb.Test.Test:output_type -> pb.TestResponse
159 1, // [1:2] is the sub-list for method output_type
160 0, // [0:1] is the sub-list for method input_type
161 0, // [0:0] is the sub-list for extension type_name
162 0, // [0:0] is the sub-list for extension extendee
163 0, // [0:0] is the sub-list for field type_name
164 }
165
166 func init() { file_test_proto_init() }
167 func file_test_proto_init() {
168 if File_test_proto != nil {
169 return
170 }
171 if !protoimpl.UnsafeEnabled {
172 file_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
173 switch v := v.(*TestRequest); i {
174 case 0:
175 return &v.state
176 case 1:
177 return &v.sizeCache
178 case 2:
179 return &v.unknownFields
180 default:
181 return nil
182 }
183 }
184 file_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
185 switch v := v.(*TestResponse); i {
186 case 0:
187 return &v.state
188 case 1:
189 return &v.sizeCache
190 case 2:
191 return &v.unknownFields
192 default:
193 return nil
194 }
195 }
196 }
197 type x struct{}
198 out := protoimpl.TypeBuilder{
199 File: protoimpl.DescBuilder{
200 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
201 RawDescriptor: file_test_proto_rawDesc,
202 NumEnums: 0,
203 NumMessages: 2,
204 NumExtensions: 0,
205 NumServices: 1,
196206 },
197 },
198 Streams: []grpc.StreamDesc{},
199 Metadata: "test.proto",
200 }
207 GoTypes: file_test_proto_goTypes,
208 DependencyIndexes: file_test_proto_depIdxs,
209 MessageInfos: file_test_proto_msgTypes,
210 }.Build()
211 File_test_proto = out.File
212 file_test_proto_rawDesc = nil
213 file_test_proto_goTypes = nil
214 file_test_proto_depIdxs = nil
215 }
0 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
1
2 package pb
3
4 import (
5 context "context"
6 grpc "google.golang.org/grpc"
7 codes "google.golang.org/grpc/codes"
8 status "google.golang.org/grpc/status"
9 )
10
11 // This is a compile-time assertion to ensure that this generated file
12 // is compatible with the grpc package it is being compiled against.
13 // Requires gRPC-Go v1.32.0 or later.
14 const _ = grpc.SupportPackageIsVersion7
15
16 // TestClient is the client API for Test service.
17 //
18 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
19 type TestClient interface {
20 Test(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error)
21 }
22
23 type testClient struct {
24 cc grpc.ClientConnInterface
25 }
26
27 func NewTestClient(cc grpc.ClientConnInterface) TestClient {
28 return &testClient{cc}
29 }
30
31 func (c *testClient) Test(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error) {
32 out := new(TestResponse)
33 err := c.cc.Invoke(ctx, "/pb.Test/Test", in, out, opts...)
34 if err != nil {
35 return nil, err
36 }
37 return out, nil
38 }
39
40 // TestServer is the server API for Test service.
41 // All implementations must embed UnimplementedTestServer
42 // for forward compatibility
43 type TestServer interface {
44 Test(context.Context, *TestRequest) (*TestResponse, error)
45 mustEmbedUnimplementedTestServer()
46 }
47
48 // UnimplementedTestServer must be embedded to have forward compatible implementations.
49 type UnimplementedTestServer struct {
50 }
51
52 func (UnimplementedTestServer) Test(context.Context, *TestRequest) (*TestResponse, error) {
53 return nil, status.Errorf(codes.Unimplemented, "method Test not implemented")
54 }
55 func (UnimplementedTestServer) mustEmbedUnimplementedTestServer() {}
56
57 // UnsafeTestServer may be embedded to opt out of forward compatibility for this service.
58 // Use of this interface is not recommended, as added methods to TestServer will
59 // result in compilation errors.
60 type UnsafeTestServer interface {
61 mustEmbedUnimplementedTestServer()
62 }
63
64 func RegisterTestServer(s grpc.ServiceRegistrar, srv TestServer) {
65 s.RegisterService(&Test_ServiceDesc, srv)
66 }
67
68 func _Test_Test_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
69 in := new(TestRequest)
70 if err := dec(in); err != nil {
71 return nil, err
72 }
73 if interceptor == nil {
74 return srv.(TestServer).Test(ctx, in)
75 }
76 info := &grpc.UnaryServerInfo{
77 Server: srv,
78 FullMethod: "/pb.Test/Test",
79 }
80 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
81 return srv.(TestServer).Test(ctx, req.(*TestRequest))
82 }
83 return interceptor(ctx, in, info, handler)
84 }
85
86 // Test_ServiceDesc is the grpc.ServiceDesc for Test service.
87 // It's only intended for direct use with grpc.RegisterService,
88 // and not to be introspected or modified (even as a copy)
89 var Test_ServiceDesc = grpc.ServiceDesc{
90 ServiceName: "pb.Test",
91 HandlerType: (*TestServer)(nil),
92 Methods: []grpc.MethodDesc{
93 {
94 MethodName: "Test",
95 Handler: _Test_Test_Handler,
96 },
97 },
98 Streams: []grpc.StreamDesc{},
99 Metadata: "test.proto",
100 }
3030 }
3131
3232 type serverBinding struct {
33 pb.UnimplementedTestServer
34
3335 test grpctransport.Handler
3436 }
3537
77 "net/http"
88
99 httptransport "github.com/go-kit/kit/transport/http"
10 "github.com/golang/protobuf/proto"
10 "google.golang.org/protobuf/proto"
1111 )
1212
1313 // EncodeProtoRequest is an EncodeRequestFunc that serializes the request as Protobuf.
0 package proto
1
2 //go:generate protoc proto_test.proto --go_out=. --go_opt=Mproto_test.proto=github.com/go-kit/kit/transport/http/proto --go_opt=paths=source_relative
3 //go:generate mv proto_test.pb.go proto_pb_test.go
00 // Code generated by protoc-gen-go. DO NOT EDIT.
1 // versions:
2 // protoc-gen-go v1.26.0
3 // protoc v3.16.0
14 // source: proto_test.proto
25
36 package proto
47
58 import (
6 fmt "fmt"
7 math "math"
8
9 proto "github.com/golang/protobuf/proto"
9 protoreflect "google.golang.org/protobuf/reflect/protoreflect"
10 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
11 reflect "reflect"
12 sync "sync"
1013 )
1114
12 // Reference imports to suppress errors if they are not otherwise used.
13 var _ = proto.Marshal
14 var _ = fmt.Errorf
15 var _ = math.Inf
16
17 // This is a compile-time assertion to ensure that this generated file
18 // is compatible with the proto package it is being compiled against.
19 // A compilation error at this line likely means your copy of the
20 // proto package needs to be updated.
21 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
15 const (
16 // Verify that this generated code is sufficiently up-to-date.
17 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
18 // Verify that runtime/protoimpl is sufficiently up-to-date.
19 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
20 )
2221
2322 type Cat struct {
24 Age int32 `protobuf:"varint,1,opt,name=Age,proto3" json:"Age,omitempty"`
25 Breed string `protobuf:"bytes,2,opt,name=Breed,proto3" json:"Breed,omitempty"`
26 Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"`
27 XXX_NoUnkeyedLiteral struct{} `json:"-"`
28 XXX_unrecognized []byte `json:"-"`
29 XXX_sizecache int32 `json:"-"`
23 state protoimpl.MessageState
24 sizeCache protoimpl.SizeCache
25 unknownFields protoimpl.UnknownFields
26
27 Age int32 `protobuf:"varint,1,opt,name=Age,proto3" json:"Age,omitempty"`
28 Breed string `protobuf:"bytes,2,opt,name=Breed,proto3" json:"Breed,omitempty"`
29 Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"`
3030 }
3131
32 func (m *Cat) Reset() { *m = Cat{} }
33 func (m *Cat) String() string { return proto.CompactTextString(m) }
34 func (*Cat) ProtoMessage() {}
35 func (*Cat) Descriptor() ([]byte, []int) {
36 return fileDescriptor_a794ba8d0e5440a3, []int{0}
32 func (x *Cat) Reset() {
33 *x = Cat{}
34 if protoimpl.UnsafeEnabled {
35 mi := &file_proto_test_proto_msgTypes[0]
36 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
37 ms.StoreMessageInfo(mi)
38 }
3739 }
3840
39 func (m *Cat) XXX_Unmarshal(b []byte) error {
40 return xxx_messageInfo_Cat.Unmarshal(m, b)
41 }
42 func (m *Cat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
43 return xxx_messageInfo_Cat.Marshal(b, m, deterministic)
44 }
45 func (m *Cat) XXX_Merge(src proto.Message) {
46 xxx_messageInfo_Cat.Merge(m, src)
47 }
48 func (m *Cat) XXX_Size() int {
49 return xxx_messageInfo_Cat.Size(m)
50 }
51 func (m *Cat) XXX_DiscardUnknown() {
52 xxx_messageInfo_Cat.DiscardUnknown(m)
41 func (x *Cat) String() string {
42 return protoimpl.X.MessageStringOf(x)
5343 }
5444
55 var xxx_messageInfo_Cat proto.InternalMessageInfo
45 func (*Cat) ProtoMessage() {}
5646
57 func (m *Cat) GetAge() int32 {
58 if m != nil {
59 return m.Age
47 func (x *Cat) ProtoReflect() protoreflect.Message {
48 mi := &file_proto_test_proto_msgTypes[0]
49 if protoimpl.UnsafeEnabled && x != nil {
50 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
51 if ms.LoadMessageInfo() == nil {
52 ms.StoreMessageInfo(mi)
53 }
54 return ms
55 }
56 return mi.MessageOf(x)
57 }
58
59 // Deprecated: Use Cat.ProtoReflect.Descriptor instead.
60 func (*Cat) Descriptor() ([]byte, []int) {
61 return file_proto_test_proto_rawDescGZIP(), []int{0}
62 }
63
64 func (x *Cat) GetAge() int32 {
65 if x != nil {
66 return x.Age
6067 }
6168 return 0
6269 }
6370
64 func (m *Cat) GetBreed() string {
65 if m != nil {
66 return m.Breed
71 func (x *Cat) GetBreed() string {
72 if x != nil {
73 return x.Breed
6774 }
6875 return ""
6976 }
7077
71 func (m *Cat) GetName() string {
72 if m != nil {
73 return m.Name
78 func (x *Cat) GetName() string {
79 if x != nil {
80 return x.Name
7481 }
7582 return ""
7683 }
7784
78 func init() {
79 proto.RegisterType((*Cat)(nil), "Cat")
85 var File_proto_test_proto protoreflect.FileDescriptor
86
87 var file_proto_test_proto_rawDesc = []byte{
88 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f,
89 0x74, 0x6f, 0x22, 0x41, 0x0a, 0x03, 0x43, 0x61, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x41, 0x67, 0x65,
90 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x41, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x42,
91 0x72, 0x65, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x42, 0x72, 0x65, 0x65,
92 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
93 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
8094 }
8195
82 func init() { proto.RegisterFile("proto_test.proto", fileDescriptor_a794ba8d0e5440a3) }
96 var (
97 file_proto_test_proto_rawDescOnce sync.Once
98 file_proto_test_proto_rawDescData = file_proto_test_proto_rawDesc
99 )
83100
84 var fileDescriptor_a794ba8d0e5440a3 = []byte{
85 // 98 bytes of a gzipped FileDescriptorProto
86 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x28, 0x28, 0xca, 0x2f,
87 0xc9, 0x8f, 0x2f, 0x49, 0x2d, 0x2e, 0xd1, 0x03, 0x33, 0x95, 0x1c, 0xb9, 0x98, 0x9d, 0x13, 0x4b,
88 0x84, 0x04, 0xb8, 0x98, 0x1d, 0xd3, 0x53, 0x25, 0x18, 0x15, 0x18, 0x35, 0x58, 0x83, 0x40, 0x4c,
89 0x21, 0x11, 0x2e, 0x56, 0xa7, 0xa2, 0xd4, 0xd4, 0x14, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xce, 0x20,
90 0x08, 0x47, 0x48, 0x88, 0x8b, 0xc5, 0x2f, 0x31, 0x37, 0x55, 0x82, 0x19, 0x2c, 0x08, 0x66, 0x27,
91 0xb1, 0x81, 0x4d, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x95, 0x83, 0x0a, 0x5d, 0x00,
92 0x00, 0x00,
101 func file_proto_test_proto_rawDescGZIP() []byte {
102 file_proto_test_proto_rawDescOnce.Do(func() {
103 file_proto_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_test_proto_rawDescData)
104 })
105 return file_proto_test_proto_rawDescData
93106 }
107
108 var file_proto_test_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
109 var file_proto_test_proto_goTypes = []interface{}{
110 (*Cat)(nil), // 0: Cat
111 }
112 var file_proto_test_proto_depIdxs = []int32{
113 0, // [0:0] is the sub-list for method output_type
114 0, // [0:0] is the sub-list for method input_type
115 0, // [0:0] is the sub-list for extension type_name
116 0, // [0:0] is the sub-list for extension extendee
117 0, // [0:0] is the sub-list for field type_name
118 }
119
120 func init() { file_proto_test_proto_init() }
121 func file_proto_test_proto_init() {
122 if File_proto_test_proto != nil {
123 return
124 }
125 if !protoimpl.UnsafeEnabled {
126 file_proto_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
127 switch v := v.(*Cat); i {
128 case 0:
129 return &v.state
130 case 1:
131 return &v.sizeCache
132 case 2:
133 return &v.unknownFields
134 default:
135 return nil
136 }
137 }
138 }
139 type x struct{}
140 out := protoimpl.TypeBuilder{
141 File: protoimpl.DescBuilder{
142 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
143 RawDescriptor: file_proto_test_proto_rawDesc,
144 NumEnums: 0,
145 NumMessages: 1,
146 NumExtensions: 0,
147 NumServices: 0,
148 },
149 GoTypes: file_proto_test_proto_goTypes,
150 DependencyIndexes: file_proto_test_proto_depIdxs,
151 MessageInfos: file_proto_test_proto_msgTypes,
152 }.Build()
153 File_proto_test_proto = out.File
154 file_proto_test_proto_rawDesc = nil
155 file_proto_test_proto_goTypes = nil
156 file_proto_test_proto_depIdxs = nil
157 }
55 "net/http/httptest"
66 "testing"
77
8 "github.com/golang/protobuf/proto"
8 "google.golang.org/protobuf/proto"
99 )
1010
1111 func TestEncodeProtoRequest(t *testing.T) {
55 "net/http"
66
77 httptransport "github.com/go-kit/kit/transport/http"
8 "github.com/golang/protobuf/proto"
8 "google.golang.org/protobuf/proto"
99 )
1010
1111 // EncodeProtoResponse is an EncodeResponseFunc that serializes the response as Protobuf.