Codebase list golang-github-go-kit-kit / f688401
Replace "x/net/context" import with "context" (#810) Marsel Mavletkulov authored 4 years ago Peter Bourgon committed 4 years ago
6 changed file(s) with 247 addition(s) and 139 deletion(s). Raw diff Collapse all Expand all
00 // Code generated by protoc-gen-go. DO NOT EDIT.
11 // source: addsvc.proto
22
3 /*
4 Package pb is a generated protocol buffer package.
5
6 It is generated from these files:
7 addsvc.proto
8
9 It has these top-level messages:
10 SumRequest
11 SumReply
12 ConcatRequest
13 ConcatReply
14 */
153 package pb
164
17 import proto "github.com/golang/protobuf/proto"
18 import fmt "fmt"
19 import math "math"
20
215 import (
22 context "golang.org/x/net/context"
6 context "context"
7 fmt "fmt"
8 proto "github.com/golang/protobuf/proto"
239 grpc "google.golang.org/grpc"
10 math "math"
2411 )
2512
2613 // Reference imports to suppress errors if they are not otherwise used.
3219 // is compatible with the proto package it is being compiled against.
3320 // A compilation error at this line likely means your copy of the
3421 // proto package needs to be updated.
35 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
22 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
3623
3724 // The sum request contains two parameters.
3825 type SumRequest struct {
39 A int64 `protobuf:"varint,1,opt,name=a" json:"a,omitempty"`
40 B int64 `protobuf:"varint,2,opt,name=b" json:"b,omitempty"`
41 }
42
43 func (m *SumRequest) Reset() { *m = SumRequest{} }
44 func (m *SumRequest) String() string { return proto.CompactTextString(m) }
45 func (*SumRequest) ProtoMessage() {}
46 func (*SumRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
26 A int64 `protobuf:"varint,1,opt,name=a,proto3" json:"a,omitempty"`
27 B int64 `protobuf:"varint,2,opt,name=b,proto3" json:"b,omitempty"`
28 XXX_NoUnkeyedLiteral struct{} `json:"-"`
29 XXX_unrecognized []byte `json:"-"`
30 XXX_sizecache int32 `json:"-"`
31 }
32
33 func (m *SumRequest) Reset() { *m = SumRequest{} }
34 func (m *SumRequest) String() string { return proto.CompactTextString(m) }
35 func (*SumRequest) ProtoMessage() {}
36 func (*SumRequest) Descriptor() ([]byte, []int) {
37 return fileDescriptor_174367f558d60c26, []int{0}
38 }
39
40 func (m *SumRequest) XXX_Unmarshal(b []byte) error {
41 return xxx_messageInfo_SumRequest.Unmarshal(m, b)
42 }
43 func (m *SumRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
44 return xxx_messageInfo_SumRequest.Marshal(b, m, deterministic)
45 }
46 func (m *SumRequest) XXX_Merge(src proto.Message) {
47 xxx_messageInfo_SumRequest.Merge(m, src)
48 }
49 func (m *SumRequest) XXX_Size() int {
50 return xxx_messageInfo_SumRequest.Size(m)
51 }
52 func (m *SumRequest) XXX_DiscardUnknown() {
53 xxx_messageInfo_SumRequest.DiscardUnknown(m)
54 }
55
56 var xxx_messageInfo_SumRequest proto.InternalMessageInfo
4757
4858 func (m *SumRequest) GetA() int64 {
4959 if m != nil {
6171
6272 // The sum response contains the result of the calculation.
6373 type SumReply struct {
64 V int64 `protobuf:"varint,1,opt,name=v" json:"v,omitempty"`
65 Err string `protobuf:"bytes,2,opt,name=err" json:"err,omitempty"`
66 }
67
68 func (m *SumReply) Reset() { *m = SumReply{} }
69 func (m *SumReply) String() string { return proto.CompactTextString(m) }
70 func (*SumReply) ProtoMessage() {}
71 func (*SumReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
74 V int64 `protobuf:"varint,1,opt,name=v,proto3" json:"v,omitempty"`
75 Err string `protobuf:"bytes,2,opt,name=err,proto3" json:"err,omitempty"`
76 XXX_NoUnkeyedLiteral struct{} `json:"-"`
77 XXX_unrecognized []byte `json:"-"`
78 XXX_sizecache int32 `json:"-"`
79 }
80
81 func (m *SumReply) Reset() { *m = SumReply{} }
82 func (m *SumReply) String() string { return proto.CompactTextString(m) }
83 func (*SumReply) ProtoMessage() {}
84 func (*SumReply) Descriptor() ([]byte, []int) {
85 return fileDescriptor_174367f558d60c26, []int{1}
86 }
87
88 func (m *SumReply) XXX_Unmarshal(b []byte) error {
89 return xxx_messageInfo_SumReply.Unmarshal(m, b)
90 }
91 func (m *SumReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
92 return xxx_messageInfo_SumReply.Marshal(b, m, deterministic)
93 }
94 func (m *SumReply) XXX_Merge(src proto.Message) {
95 xxx_messageInfo_SumReply.Merge(m, src)
96 }
97 func (m *SumReply) XXX_Size() int {
98 return xxx_messageInfo_SumReply.Size(m)
99 }
100 func (m *SumReply) XXX_DiscardUnknown() {
101 xxx_messageInfo_SumReply.DiscardUnknown(m)
102 }
103
104 var xxx_messageInfo_SumReply proto.InternalMessageInfo
72105
73106 func (m *SumReply) GetV() int64 {
74107 if m != nil {
86119
87120 // The Concat request contains two parameters.
88121 type ConcatRequest struct {
89 A string `protobuf:"bytes,1,opt,name=a" json:"a,omitempty"`
90 B string `protobuf:"bytes,2,opt,name=b" json:"b,omitempty"`
91 }
92
93 func (m *ConcatRequest) Reset() { *m = ConcatRequest{} }
94 func (m *ConcatRequest) String() string { return proto.CompactTextString(m) }
95 func (*ConcatRequest) ProtoMessage() {}
96 func (*ConcatRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
122 A string `protobuf:"bytes,1,opt,name=a,proto3" json:"a,omitempty"`
123 B string `protobuf:"bytes,2,opt,name=b,proto3" json:"b,omitempty"`
124 XXX_NoUnkeyedLiteral struct{} `json:"-"`
125 XXX_unrecognized []byte `json:"-"`
126 XXX_sizecache int32 `json:"-"`
127 }
128
129 func (m *ConcatRequest) Reset() { *m = ConcatRequest{} }
130 func (m *ConcatRequest) String() string { return proto.CompactTextString(m) }
131 func (*ConcatRequest) ProtoMessage() {}
132 func (*ConcatRequest) Descriptor() ([]byte, []int) {
133 return fileDescriptor_174367f558d60c26, []int{2}
134 }
135
136 func (m *ConcatRequest) XXX_Unmarshal(b []byte) error {
137 return xxx_messageInfo_ConcatRequest.Unmarshal(m, b)
138 }
139 func (m *ConcatRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
140 return xxx_messageInfo_ConcatRequest.Marshal(b, m, deterministic)
141 }
142 func (m *ConcatRequest) XXX_Merge(src proto.Message) {
143 xxx_messageInfo_ConcatRequest.Merge(m, src)
144 }
145 func (m *ConcatRequest) XXX_Size() int {
146 return xxx_messageInfo_ConcatRequest.Size(m)
147 }
148 func (m *ConcatRequest) XXX_DiscardUnknown() {
149 xxx_messageInfo_ConcatRequest.DiscardUnknown(m)
150 }
151
152 var xxx_messageInfo_ConcatRequest proto.InternalMessageInfo
97153
98154 func (m *ConcatRequest) GetA() string {
99155 if m != nil {
111167
112168 // The Concat response contains the result of the concatenation.
113169 type ConcatReply struct {
114 V string `protobuf:"bytes,1,opt,name=v" json:"v,omitempty"`
115 Err string `protobuf:"bytes,2,opt,name=err" json:"err,omitempty"`
116 }
117
118 func (m *ConcatReply) Reset() { *m = ConcatReply{} }
119 func (m *ConcatReply) String() string { return proto.CompactTextString(m) }
120 func (*ConcatReply) ProtoMessage() {}
121 func (*ConcatReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
170 V string `protobuf:"bytes,1,opt,name=v,proto3" json:"v,omitempty"`
171 Err string `protobuf:"bytes,2,opt,name=err,proto3" json:"err,omitempty"`
172 XXX_NoUnkeyedLiteral struct{} `json:"-"`
173 XXX_unrecognized []byte `json:"-"`
174 XXX_sizecache int32 `json:"-"`
175 }
176
177 func (m *ConcatReply) Reset() { *m = ConcatReply{} }
178 func (m *ConcatReply) String() string { return proto.CompactTextString(m) }
179 func (*ConcatReply) ProtoMessage() {}
180 func (*ConcatReply) Descriptor() ([]byte, []int) {
181 return fileDescriptor_174367f558d60c26, []int{3}
182 }
183
184 func (m *ConcatReply) XXX_Unmarshal(b []byte) error {
185 return xxx_messageInfo_ConcatReply.Unmarshal(m, b)
186 }
187 func (m *ConcatReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
188 return xxx_messageInfo_ConcatReply.Marshal(b, m, deterministic)
189 }
190 func (m *ConcatReply) XXX_Merge(src proto.Message) {
191 xxx_messageInfo_ConcatReply.Merge(m, src)
192 }
193 func (m *ConcatReply) XXX_Size() int {
194 return xxx_messageInfo_ConcatReply.Size(m)
195 }
196 func (m *ConcatReply) XXX_DiscardUnknown() {
197 xxx_messageInfo_ConcatReply.DiscardUnknown(m)
198 }
199
200 var xxx_messageInfo_ConcatReply proto.InternalMessageInfo
122201
123202 func (m *ConcatReply) GetV() string {
124203 if m != nil {
141220 proto.RegisterType((*ConcatReply)(nil), "pb.ConcatReply")
142221 }
143222
223 func init() { proto.RegisterFile("addsvc.proto", fileDescriptor_174367f558d60c26) }
224
225 var fileDescriptor_174367f558d60c26 = []byte{
226 // 189 bytes of a gzipped FileDescriptorProto
227 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0x4c, 0x49, 0x29,
228 0x2e, 0x4b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2a, 0x48, 0x52, 0xd2, 0xe0, 0xe2,
229 0x0a, 0x2e, 0xcd, 0x0d, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0xe2, 0xe1, 0x62, 0x4c, 0x94,
230 0x60, 0x54, 0x60, 0xd4, 0x60, 0x0e, 0x62, 0x4c, 0x04, 0xf1, 0x92, 0x24, 0x98, 0x20, 0xbc, 0x24,
231 0x25, 0x2d, 0x2e, 0x0e, 0xb0, 0xca, 0x82, 0x9c, 0x4a, 0x90, 0x4c, 0x19, 0x4c, 0x5d, 0x99, 0x90,
232 0x00, 0x17, 0x73, 0x6a, 0x51, 0x11, 0x58, 0x25, 0x67, 0x10, 0x88, 0xa9, 0xa4, 0xcd, 0xc5, 0xeb,
233 0x9c, 0x9f, 0x97, 0x9c, 0x58, 0x82, 0x61, 0x30, 0x27, 0x8a, 0xc1, 0x9c, 0x20, 0x83, 0x75, 0xb9,
234 0xb8, 0x61, 0x8a, 0x51, 0xcc, 0xe6, 0xc4, 0x6a, 0xb6, 0x51, 0x0c, 0x17, 0xb3, 0x63, 0x4a, 0x8a,
235 0x90, 0x2a, 0x17, 0x73, 0x70, 0x69, 0xae, 0x10, 0x9f, 0x5e, 0x41, 0x92, 0x1e, 0xc2, 0x07, 0x52,
236 0x3c, 0x70, 0x7e, 0x41, 0x4e, 0xa5, 0x12, 0x83, 0x90, 0x1e, 0x17, 0x1b, 0xc4, 0x70, 0x21, 0x41,
237 0x90, 0x0c, 0x8a, 0xab, 0xa4, 0xf8, 0x91, 0x85, 0xc0, 0xea, 0x93, 0xd8, 0xc0, 0x41, 0x63, 0x0c,
238 0x08, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x37, 0x81, 0x99, 0x2a, 0x01, 0x00, 0x00,
239 }
240
144241 // Reference imports to suppress errors if they are not otherwise used.
145242 var _ context.Context
146243 var _ grpc.ClientConn
149246 // is compatible with the grpc package it is being compiled against.
150247 const _ = grpc.SupportPackageIsVersion4
151248
152 // Client API for Add service
153
249 // AddClient is the client API for Add service.
250 //
251 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
154252 type AddClient interface {
155253 // Sums two integers.
156254 Sum(ctx context.Context, in *SumRequest, opts ...grpc.CallOption) (*SumReply, error)
168266
169267 func (c *addClient) Sum(ctx context.Context, in *SumRequest, opts ...grpc.CallOption) (*SumReply, error) {
170268 out := new(SumReply)
171 err := grpc.Invoke(ctx, "/pb.Add/Sum", in, out, c.cc, opts...)
269 err := c.cc.Invoke(ctx, "/pb.Add/Sum", in, out, opts...)
172270 if err != nil {
173271 return nil, err
174272 }
177275
178276 func (c *addClient) Concat(ctx context.Context, in *ConcatRequest, opts ...grpc.CallOption) (*ConcatReply, error) {
179277 out := new(ConcatReply)
180 err := grpc.Invoke(ctx, "/pb.Add/Concat", in, out, c.cc, opts...)
278 err := c.cc.Invoke(ctx, "/pb.Add/Concat", in, out, opts...)
181279 if err != nil {
182280 return nil, err
183281 }
184282 return out, nil
185283 }
186284
187 // Server API for Add service
188
285 // AddServer is the server API for Add service.
189286 type AddServer interface {
190287 // Sums two integers.
191288 Sum(context.Context, *SumRequest) (*SumReply, error)
249346 Streams: []grpc.StreamDesc{},
250347 Metadata: "addsvc.proto",
251348 }
252
253 func init() { proto.RegisterFile("addsvc.proto", fileDescriptor0) }
254
255 var fileDescriptor0 = []byte{
256 // 189 bytes of a gzipped FileDescriptorProto
257 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0x4c, 0x49, 0x29,
258 0x2e, 0x4b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2a, 0x48, 0x52, 0xd2, 0xe0, 0xe2,
259 0x0a, 0x2e, 0xcd, 0x0d, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0xe2, 0xe1, 0x62, 0x4c, 0x94,
260 0x60, 0x54, 0x60, 0xd4, 0x60, 0x0e, 0x62, 0x4c, 0x04, 0xf1, 0x92, 0x24, 0x98, 0x20, 0xbc, 0x24,
261 0x25, 0x2d, 0x2e, 0x0e, 0xb0, 0xca, 0x82, 0x9c, 0x4a, 0x90, 0x4c, 0x19, 0x4c, 0x5d, 0x99, 0x90,
262 0x00, 0x17, 0x73, 0x6a, 0x51, 0x11, 0x58, 0x25, 0x67, 0x10, 0x88, 0xa9, 0xa4, 0xcd, 0xc5, 0xeb,
263 0x9c, 0x9f, 0x97, 0x9c, 0x58, 0x82, 0x61, 0x30, 0x27, 0x8a, 0xc1, 0x9c, 0x20, 0x83, 0x75, 0xb9,
264 0xb8, 0x61, 0x8a, 0x51, 0xcc, 0xe6, 0xc4, 0x6a, 0xb6, 0x51, 0x0c, 0x17, 0xb3, 0x63, 0x4a, 0x8a,
265 0x90, 0x2a, 0x17, 0x73, 0x70, 0x69, 0xae, 0x10, 0x9f, 0x5e, 0x41, 0x92, 0x1e, 0xc2, 0x07, 0x52,
266 0x3c, 0x70, 0x7e, 0x41, 0x4e, 0xa5, 0x12, 0x83, 0x90, 0x1e, 0x17, 0x1b, 0xc4, 0x70, 0x21, 0x41,
267 0x90, 0x0c, 0x8a, 0xab, 0xa4, 0xf8, 0x91, 0x85, 0xc0, 0xea, 0x93, 0xd8, 0xc0, 0x41, 0x63, 0x0c,
268 0x08, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x37, 0x81, 0x99, 0x2a, 0x01, 0x00, 0x00,
269 }
99 stdopentracing "github.com/opentracing/opentracing-go"
1010 stdzipkin "github.com/openzipkin/zipkin-go"
1111 "github.com/sony/gobreaker"
12 oldcontext "golang.org/x/net/context"
1312 "golang.org/x/time/rate"
1413
1514 "github.com/go-kit/kit/circuitbreaker"
6463 }
6564 }
6665
67 func (s *grpcServer) Sum(ctx oldcontext.Context, req *pb.SumRequest) (*pb.SumReply, error) {
66 func (s *grpcServer) Sum(ctx context.Context, req *pb.SumRequest) (*pb.SumReply, error) {
6867 _, rep, err := s.sum.ServeGRPC(ctx, req)
6968 if err != nil {
7069 return nil, err
7271 return rep.(*pb.SumReply), nil
7372 }
7473
75 func (s *grpcServer) Concat(ctx oldcontext.Context, req *pb.ConcatRequest) (*pb.ConcatReply, error) {
74 func (s *grpcServer) Concat(ctx context.Context, req *pb.ConcatRequest) (*pb.ConcatReply, error) {
7675 _, rep, err := s.concat.ServeGRPC(ctx, req)
7776 if err != nil {
7877 return nil, err
44 "reflect"
55 "testing"
66 "time"
7
8 "golang.org/x/net/context"
7 "context"
98
109 etcd "go.etcd.io/etcd/client"
1110 )
0 // Code generated by protoc-gen-go.
0 // Code generated by protoc-gen-go. DO NOT EDIT.
11 // source: test.proto
2 // DO NOT EDIT!
3
4 /*
5 Package pb is a generated protocol buffer package.
6
7 It is generated from these files:
8 test.proto
9
10 It has these top-level messages:
11 TestRequest
12 TestResponse
13 */
2
143 package pb
154
16 import proto "github.com/golang/protobuf/proto"
17 import fmt "fmt"
18 import math "math"
19
205 import (
21 context "golang.org/x/net/context"
6 context "context"
7 fmt "fmt"
8 proto "github.com/golang/protobuf/proto"
229 grpc "google.golang.org/grpc"
10 math "math"
2311 )
2412
2513 // Reference imports to suppress errors if they are not otherwise used.
3119 // is compatible with the proto package it is being compiled against.
3220 // A compilation error at this line likely means your copy of the
3321 // proto package needs to be updated.
34 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
22 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
3523
3624 type TestRequest struct {
37 A string `protobuf:"bytes,1,opt,name=a" json:"a,omitempty"`
38 B int64 `protobuf:"varint,2,opt,name=b" json:"b,omitempty"`
39 }
40
41 func (m *TestRequest) Reset() { *m = TestRequest{} }
42 func (m *TestRequest) String() string { return proto.CompactTextString(m) }
43 func (*TestRequest) ProtoMessage() {}
44 func (*TestRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
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() {}
35 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
4556
4657 func (m *TestRequest) GetA() string {
4758 if m != nil {
5869 }
5970
6071 type TestResponse struct {
61 V string `protobuf:"bytes,1,opt,name=v" json:"v,omitempty"`
62 }
63
64 func (m *TestResponse) Reset() { *m = TestResponse{} }
65 func (m *TestResponse) String() string { return proto.CompactTextString(m) }
66 func (*TestResponse) ProtoMessage() {}
67 func (*TestResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
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() {}
81 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
68102
69103 func (m *TestResponse) GetV() string {
70104 if m != nil {
78112 proto.RegisterType((*TestResponse)(nil), "pb.TestResponse")
79113 }
80114
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
81130 // Reference imports to suppress errors if they are not otherwise used.
82131 var _ context.Context
83132 var _ grpc.ClientConn
86135 // is compatible with the grpc package it is being compiled against.
87136 const _ = grpc.SupportPackageIsVersion4
88137
89 // Client API for Test service
90
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.
91141 type TestClient interface {
92142 Test(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error)
93143 }
102152
103153 func (c *testClient) Test(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error) {
104154 out := new(TestResponse)
105 err := grpc.Invoke(ctx, "/pb.Test/Test", in, out, c.cc, opts...)
155 err := c.cc.Invoke(ctx, "/pb.Test/Test", in, out, opts...)
106156 if err != nil {
107157 return nil, err
108158 }
109159 return out, nil
110160 }
111161
112 // Server API for Test service
113
162 // TestServer is the server API for Test service.
114163 type TestServer interface {
115164 Test(context.Context, *TestRequest) (*TestResponse, error)
116165 }
149198 Streams: []grpc.StreamDesc{},
150199 Metadata: "test.proto",
151200 }
152
153 func init() { proto.RegisterFile("test.proto", fileDescriptor0) }
154
155 var fileDescriptor0 = []byte{
156 // 129 bytes of a gzipped FileDescriptorProto
157 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0x49, 0x2d, 0x2e,
158 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2a, 0x48, 0x52, 0xd2, 0xe4, 0xe2, 0x0e, 0x49,
159 0x2d, 0x2e, 0x09, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0xe2, 0xe1, 0x62, 0x4c, 0x94, 0x60,
160 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x62, 0x4c, 0x04, 0xf1, 0x92, 0x24, 0x98, 0x14, 0x18, 0x35, 0x98,
161 0x83, 0x18, 0x93, 0x94, 0x64, 0xb8, 0x78, 0x20, 0x4a, 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x41,
162 0xb2, 0x65, 0x30, 0xb5, 0x65, 0x46, 0xc6, 0x5c, 0x2c, 0x20, 0x59, 0x21, 0x6d, 0x28, 0xcd, 0xaf,
163 0x57, 0x90, 0xa4, 0x87, 0x64, 0xb4, 0x94, 0x00, 0x42, 0x00, 0x62, 0x80, 0x12, 0x43, 0x12, 0x1b,
164 0xd8, 0x21, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x49, 0xfc, 0xd8, 0xf1, 0x96, 0x00, 0x00,
165 0x00,
166 }
22 import (
33 "context"
44 "fmt"
5
6 oldcontext "golang.org/x/net/context"
75
86 "github.com/go-kit/kit/endpoint"
97 grpctransport "github.com/go-kit/kit/transport/grpc"
3533 test grpctransport.Handler
3634 }
3735
38 func (b *serverBinding) Test(ctx oldcontext.Context, req *pb.TestRequest) (*pb.TestResponse, error) {
36 func (b *serverBinding) Test(ctx context.Context, req *pb.TestRequest) (*pb.TestResponse, error) {
3937 _, response, err := b.test.ServeGRPC(ctx, req)
4038 if err != nil {
4139 return nil, err
22 import (
33 "context"
44
5 oldcontext "golang.org/x/net/context"
65 "google.golang.org/grpc"
76 "google.golang.org/grpc/metadata"
87
1413 // implementation. The incoming request parameter, and returned response
1514 // parameter, are both gRPC types, not user-domain.
1615 type Handler interface {
17 ServeGRPC(ctx oldcontext.Context, request interface{}) (oldcontext.Context, interface{}, error)
16 ServeGRPC(ctx context.Context, request interface{}) (context.Context, interface{}, error)
1817 }
1918
2019 // Server wraps an endpoint and implements grpc.Handler.
7978 }
8079
8180 // ServeGRPC implements the Handler interface.
82 func (s Server) ServeGRPC(ctx oldcontext.Context, req interface{}) (retctx oldcontext.Context, resp interface{}, err error) {
81 func (s Server) ServeGRPC(ctx context.Context, req interface{}) (retctx context.Context, resp interface{}, err error) {
8382 // Retrieve gRPC metadata.
8483 md, ok := metadata.FromIncomingContext(ctx)
8584 if !ok {