1 // Code generated by protoc-gen-go. DO NOT EDIT.
2 // source: addsvc.proto
5 Package pb is a generated protocol buffer package.
7 It is generated from these files:
10 It has these top-level messages:
18 import proto "github.com/golang/protobuf/proto"
23 context "golang.org/x/net/context"
24 grpc "google.golang.org/grpc"
27 // Reference imports to suppress errors if they are not otherwise used.
32 // This is a compile-time assertion to ensure that this generated file
33 // is compatible with the proto package it is being compiled against.
34 // A compilation error at this line likely means your copy of the
35 // proto package needs to be updated.
36 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
38 // The sum request contains two parameters.
39 type SumRequest struct {
40 A int64 `protobuf:"varint,1,opt,name=a" json:"a,omitempty"`
41 B int64 `protobuf:"varint,2,opt,name=b" json:"b,omitempty"`
44 func (m *SumRequest) Reset() { *m = SumRequest{} }
45 func (m *SumRequest) String() string { return proto.CompactTextString(m) }
46 func (*SumRequest) ProtoMessage() {}
47 func (*SumRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
49 func (m *SumRequest) GetA() int64 {
56 func (m *SumRequest) GetB() int64 {
63 // The sum response contains the result of the calculation.
64 type SumReply struct {
65 V int64 `protobuf:"varint,1,opt,name=v" json:"v,omitempty"`
66 Err string `protobuf:"bytes,2,opt,name=err" json:"err,omitempty"`
69 func (m *SumReply) Reset() { *m = SumReply{} }
70 func (m *SumReply) String() string { return proto.CompactTextString(m) }
71 func (*SumReply) ProtoMessage() {}
72 func (*SumReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
74 func (m *SumReply) GetV() int64 {
81 func (m *SumReply) GetErr() string {
88 // The Concat request contains two parameters.
89 type ConcatRequest struct {
90 A string `protobuf:"bytes,1,opt,name=a" json:"a,omitempty"`
91 B string `protobuf:"bytes,2,opt,name=b" json:"b,omitempty"`
94 func (m *ConcatRequest) Reset() { *m = ConcatRequest{} }
95 func (m *ConcatRequest) String() string { return proto.CompactTextString(m) }
96 func (*ConcatRequest) ProtoMessage() {}
97 func (*ConcatRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
99 func (m *ConcatRequest) GetA() string {
106 func (m *ConcatRequest) GetB() string {
113 // The Concat response contains the result of the concatenation.
114 type ConcatReply struct {
115 V string `protobuf:"bytes,1,opt,name=v" json:"v,omitempty"`
116 Err string `protobuf:"bytes,2,opt,name=err" json:"err,omitempty"`
119 func (m *ConcatReply) Reset() { *m = ConcatReply{} }
120 func (m *ConcatReply) String() string { return proto.CompactTextString(m) }
121 func (*ConcatReply) ProtoMessage() {}
122 func (*ConcatReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
124 func (m *ConcatReply) GetV() string {
131 func (m *ConcatReply) GetErr() string {
139 proto.RegisterType((*SumRequest)(nil), "pb.SumRequest")
140 proto.RegisterType((*SumReply)(nil), "pb.SumReply")
141 proto.RegisterType((*ConcatRequest)(nil), "pb.ConcatRequest")
142 proto.RegisterType((*ConcatReply)(nil), "pb.ConcatReply")
145 // Reference imports to suppress errors if they are not otherwise used.
146 var _ context.Context
147 var _ grpc.ClientConn
149 // This is a compile-time assertion to ensure that this generated file
150 // is compatible with the grpc package it is being compiled against.
151 const _ = grpc.SupportPackageIsVersion4
153 // Client API for Add service
155 type AddClient interface {
156 // Sums two integers.
157 Sum(ctx context.Context, in *SumRequest, opts ...grpc.CallOption) (*SumReply, error)
158 // Concatenates two strings
159 Concat(ctx context.Context, in *ConcatRequest, opts ...grpc.CallOption) (*ConcatReply, error)
162 type addClient struct {
166 func NewAddClient(cc *grpc.ClientConn) AddClient {
167 return &addClient{cc}
170 func (c *addClient) Sum(ctx context.Context, in *SumRequest, opts ...grpc.CallOption) (*SumReply, error) {
172 err := grpc.Invoke(ctx, "/pb.Add/Sum", in, out, c.cc, opts...)
179 func (c *addClient) Concat(ctx context.Context, in *ConcatRequest, opts ...grpc.CallOption) (*ConcatReply, error) {
180 out := new(ConcatReply)
181 err := grpc.Invoke(ctx, "/pb.Add/Concat", in, out, c.cc, opts...)
188 // Server API for Add service
190 type AddServer interface {
191 // Sums two integers.
192 Sum(context.Context, *SumRequest) (*SumReply, error)
193 // Concatenates two strings
194 Concat(context.Context, *ConcatRequest) (*ConcatReply, error)
197 func RegisterAddServer(s *grpc.Server, srv AddServer) {
198 s.RegisterService(&_Add_serviceDesc, srv)
201 func _Add_Sum_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
202 in := new(SumRequest)
203 if err := dec(in); err != nil {
206 if interceptor == nil {
207 return srv.(AddServer).Sum(ctx, in)
209 info := &grpc.UnaryServerInfo{
211 FullMethod: "/pb.Add/Sum",
213 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
214 return srv.(AddServer).Sum(ctx, req.(*SumRequest))
216 return interceptor(ctx, in, info, handler)
219 func _Add_Concat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
220 in := new(ConcatRequest)
221 if err := dec(in); err != nil {
224 if interceptor == nil {
225 return srv.(AddServer).Concat(ctx, in)
227 info := &grpc.UnaryServerInfo{
229 FullMethod: "/pb.Add/Concat",
231 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
232 return srv.(AddServer).Concat(ctx, req.(*ConcatRequest))
234 return interceptor(ctx, in, info, handler)
237 var _Add_serviceDesc = grpc.ServiceDesc{
238 ServiceName: "pb.Add",
239 HandlerType: (*AddServer)(nil),
240 Methods: []grpc.MethodDesc{
243 Handler: _Add_Sum_Handler,
246 MethodName: "Concat",
247 Handler: _Add_Concat_Handler,
250 Streams: []grpc.StreamDesc{},
251 Metadata: "addsvc.proto",
254 func init() { proto.RegisterFile("addsvc.proto", fileDescriptor0) }
256 var fileDescriptor0 = []byte{
257 // 189 bytes of a gzipped FileDescriptorProto
258 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0x4c, 0x49, 0x29,
259 0x2e, 0x4b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2a, 0x48, 0x52, 0xd2, 0xe0, 0xe2,
260 0x0a, 0x2e, 0xcd, 0x0d, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0xe2, 0xe1, 0x62, 0x4c, 0x94,
261 0x60, 0x54, 0x60, 0xd4, 0x60, 0x0e, 0x62, 0x4c, 0x04, 0xf1, 0x92, 0x24, 0x98, 0x20, 0xbc, 0x24,
262 0x25, 0x2d, 0x2e, 0x0e, 0xb0, 0xca, 0x82, 0x9c, 0x4a, 0x90, 0x4c, 0x19, 0x4c, 0x5d, 0x99, 0x90,
263 0x00, 0x17, 0x73, 0x6a, 0x51, 0x11, 0x58, 0x25, 0x67, 0x10, 0x88, 0xa9, 0xa4, 0xcd, 0xc5, 0xeb,
264 0x9c, 0x9f, 0x97, 0x9c, 0x58, 0x82, 0x61, 0x30, 0x27, 0x8a, 0xc1, 0x9c, 0x20, 0x83, 0x75, 0xb9,
265 0xb8, 0x61, 0x8a, 0x51, 0xcc, 0xe6, 0xc4, 0x6a, 0xb6, 0x51, 0x0c, 0x17, 0xb3, 0x63, 0x4a, 0x8a,
266 0x90, 0x2a, 0x17, 0x73, 0x70, 0x69, 0xae, 0x10, 0x9f, 0x5e, 0x41, 0x92, 0x1e, 0xc2, 0x07, 0x52,
267 0x3c, 0x70, 0x7e, 0x41, 0x4e, 0xa5, 0x12, 0x83, 0x90, 0x1e, 0x17, 0x1b, 0xc4, 0x70, 0x21, 0x41,
268 0x90, 0x0c, 0x8a, 0xab, 0xa4, 0xf8, 0x91, 0x85, 0xc0, 0xea, 0x93, 0xd8, 0xc0, 0x41, 0x63, 0x0c,
269 0x08, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x37, 0x81, 0x99, 0x2a, 0x01, 0x00, 0x00,