-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathsum.pb.go
258 lines (226 loc) · 8.63 KB
/
sum.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: pb/sum.proto
package sumpb
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "google.golang.org/genproto/googleapis/api/annotations"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// 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
// SumRequest is a request for Summator service.
type SumRequest struct {
// A is the number we're adding to. Can't be zero for the sake of example.
A int64 `protobuf:"varint,1,opt,name=a" json:"a,omitempty"`
// B is the number we're adding.
B *NestedB `protobuf:"bytes,2,opt,name=b" json:"b,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SumRequest) Reset() { *m = SumRequest{} }
func (m *SumRequest) String() string { return proto.CompactTextString(m) }
func (*SumRequest) ProtoMessage() {}
func (*SumRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_sum_87b9ee83b8c52917, []int{0}
}
func (m *SumRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SumRequest.Unmarshal(m, b)
}
func (m *SumRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SumRequest.Marshal(b, m, deterministic)
}
func (dst *SumRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SumRequest.Merge(dst, src)
}
func (m *SumRequest) XXX_Size() int {
return xxx_messageInfo_SumRequest.Size(m)
}
func (m *SumRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SumRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SumRequest proto.InternalMessageInfo
func (m *SumRequest) GetA() int64 {
if m != nil {
return m.A
}
return 0
}
func (m *SumRequest) GetB() *NestedB {
if m != nil {
return m.B
}
return nil
}
type SumResponse struct {
Sum int64 `protobuf:"varint,1,opt,name=sum" json:"sum,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SumResponse) Reset() { *m = SumResponse{} }
func (m *SumResponse) String() string { return proto.CompactTextString(m) }
func (*SumResponse) ProtoMessage() {}
func (*SumResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_sum_87b9ee83b8c52917, []int{1}
}
func (m *SumResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SumResponse.Unmarshal(m, b)
}
func (m *SumResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SumResponse.Marshal(b, m, deterministic)
}
func (dst *SumResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_SumResponse.Merge(dst, src)
}
func (m *SumResponse) XXX_Size() int {
return xxx_messageInfo_SumResponse.Size(m)
}
func (m *SumResponse) XXX_DiscardUnknown() {
xxx_messageInfo_SumResponse.DiscardUnknown(m)
}
var xxx_messageInfo_SumResponse proto.InternalMessageInfo
func (m *SumResponse) GetSum() int64 {
if m != nil {
return m.Sum
}
return 0
}
func (m *SumResponse) GetError() string {
if m != nil {
return m.Error
}
return ""
}
type NestedB struct {
B int64 `protobuf:"varint,1,opt,name=b" json:"b,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *NestedB) Reset() { *m = NestedB{} }
func (m *NestedB) String() string { return proto.CompactTextString(m) }
func (*NestedB) ProtoMessage() {}
func (*NestedB) Descriptor() ([]byte, []int) {
return fileDescriptor_sum_87b9ee83b8c52917, []int{2}
}
func (m *NestedB) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NestedB.Unmarshal(m, b)
}
func (m *NestedB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NestedB.Marshal(b, m, deterministic)
}
func (dst *NestedB) XXX_Merge(src proto.Message) {
xxx_messageInfo_NestedB.Merge(dst, src)
}
func (m *NestedB) XXX_Size() int {
return xxx_messageInfo_NestedB.Size(m)
}
func (m *NestedB) XXX_DiscardUnknown() {
xxx_messageInfo_NestedB.DiscardUnknown(m)
}
var xxx_messageInfo_NestedB proto.InternalMessageInfo
func (m *NestedB) GetB() int64 {
if m != nil {
return m.B
}
return 0
}
func init() {
proto.RegisterType((*SumRequest)(nil), "sumpb.SumRequest")
proto.RegisterType((*SumResponse)(nil), "sumpb.SumResponse")
proto.RegisterType((*NestedB)(nil), "sumpb.NestedB")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// SummatorClient is the client API for Summator service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type SummatorClient interface {
Sum(ctx context.Context, in *SumRequest, opts ...grpc.CallOption) (*SumResponse, error)
}
type summatorClient struct {
cc *grpc.ClientConn
}
func NewSummatorClient(cc *grpc.ClientConn) SummatorClient {
return &summatorClient{cc}
}
func (c *summatorClient) Sum(ctx context.Context, in *SumRequest, opts ...grpc.CallOption) (*SumResponse, error) {
out := new(SumResponse)
err := c.cc.Invoke(ctx, "/sumpb.Summator/Sum", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// SummatorServer is the server API for Summator service.
type SummatorServer interface {
Sum(context.Context, *SumRequest) (*SumResponse, error)
}
func RegisterSummatorServer(s *grpc.Server, srv SummatorServer) {
s.RegisterService(&_Summator_serviceDesc, srv)
}
func _Summator_Sum_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SumRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SummatorServer).Sum(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/sumpb.Summator/Sum",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SummatorServer).Sum(ctx, req.(*SumRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Summator_serviceDesc = grpc.ServiceDesc{
ServiceName: "sumpb.Summator",
HandlerType: (*SummatorServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Sum",
Handler: _Summator_Sum_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "pb/sum.proto",
}
func init() { proto.RegisterFile("pb/sum.proto", fileDescriptor_sum_87b9ee83b8c52917) }
var fileDescriptor_sum_87b9ee83b8c52917 = []byte{
// 248 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b,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