forked from uber/prototool
/
hello_api.pb.go
327 lines (288 loc) · 11.6 KB
/
hello_api.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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: uber/foo/v1/hello_api.proto
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
package foov1
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
// 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.ProtoPackageIsVersion3 // please upgrade the proto package
type FooRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FooRequest) Reset() { *m = FooRequest{} }
func (m *FooRequest) String() string { return proto.CompactTextString(m) }
func (*FooRequest) ProtoMessage() {}
func (*FooRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_3a081c6ba99dbfe3, []int{0}
}
func (m *FooRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FooRequest.Unmarshal(m, b)
}
func (m *FooRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FooRequest.Marshal(b, m, deterministic)
}
func (m *FooRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_FooRequest.Merge(m, src)
}
func (m *FooRequest) XXX_Size() int {
return xxx_messageInfo_FooRequest.Size(m)
}
func (m *FooRequest) XXX_DiscardUnknown() {
xxx_messageInfo_FooRequest.DiscardUnknown(m)
}
var xxx_messageInfo_FooRequest proto.InternalMessageInfo
type FooResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FooResponse) Reset() { *m = FooResponse{} }
func (m *FooResponse) String() string { return proto.CompactTextString(m) }
func (*FooResponse) ProtoMessage() {}
func (*FooResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_3a081c6ba99dbfe3, []int{1}
}
func (m *FooResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FooResponse.Unmarshal(m, b)
}
func (m *FooResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FooResponse.Marshal(b, m, deterministic)
}
func (m *FooResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_FooResponse.Merge(m, src)
}
func (m *FooResponse) XXX_Size() int {
return xxx_messageInfo_FooResponse.Size(m)
}
func (m *FooResponse) XXX_DiscardUnknown() {
xxx_messageInfo_FooResponse.DiscardUnknown(m)
}
var xxx_messageInfo_FooResponse proto.InternalMessageInfo
type BarRequest struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BarRequest) Reset() { *m = BarRequest{} }
func (m *BarRequest) String() string { return proto.CompactTextString(m) }
func (*BarRequest) ProtoMessage() {}
func (*BarRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_3a081c6ba99dbfe3, []int{2}
}
func (m *BarRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BarRequest.Unmarshal(m, b)
}
func (m *BarRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BarRequest.Marshal(b, m, deterministic)
}
func (m *BarRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_BarRequest.Merge(m, src)
}
func (m *BarRequest) XXX_Size() int {
return xxx_messageInfo_BarRequest.Size(m)
}
func (m *BarRequest) XXX_DiscardUnknown() {
xxx_messageInfo_BarRequest.DiscardUnknown(m)
}
var xxx_messageInfo_BarRequest proto.InternalMessageInfo
func (m *BarRequest) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
type BarResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BarResponse) Reset() { *m = BarResponse{} }
func (m *BarResponse) String() string { return proto.CompactTextString(m) }
func (*BarResponse) ProtoMessage() {}
func (*BarResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_3a081c6ba99dbfe3, []int{3}
}
func (m *BarResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BarResponse.Unmarshal(m, b)
}
func (m *BarResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BarResponse.Marshal(b, m, deterministic)
}
func (m *BarResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_BarResponse.Merge(m, src)
}
func (m *BarResponse) XXX_Size() int {
return xxx_messageInfo_BarResponse.Size(m)
}
func (m *BarResponse) XXX_DiscardUnknown() {
xxx_messageInfo_BarResponse.DiscardUnknown(m)
}
var xxx_messageInfo_BarResponse proto.InternalMessageInfo
func init() {
proto.RegisterType((*FooRequest)(nil), "uber.foo.v1.FooRequest")
proto.RegisterType((*FooResponse)(nil), "uber.foo.v1.FooResponse")
proto.RegisterType((*BarRequest)(nil), "uber.foo.v1.BarRequest")
proto.RegisterType((*BarResponse)(nil), "uber.foo.v1.BarResponse")
}
func init() {
proto.RegisterFile("uber/foo/v1/hello_api.proto", fileDescriptor_3a081c6ba99dbfe3)
}
var fileDescriptor_3a081c6ba99dbfe3 = []byte{
// 227 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0x4d, 0x4a, 0x2d,
0xd2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c, 0x5b, 0x7e, 0x7e, 0x4c, 0x98, 0x61,
0x12, 0x1b, 0x38, 0xa8, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x4c, 0x48, 0x35, 0x49,
0x01, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// 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.SupportPackageIsVersion6
// HelloAPIClient is the client API for HelloAPI service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type HelloAPIClient interface {
// Foo does a foo.
Foo(ctx context.Context, in *FooRequest, opts ...grpc.CallOption) (*FooResponse, error)
// Bar does a bar.
Bar(ctx context.Context, in *BarRequest, opts ...grpc.CallOption) (*BarResponse, error)
}
type helloAPIClient struct {
cc grpc.ClientConnInterface
}
func NewHelloAPIClient(cc grpc.ClientConnInterface) HelloAPIClient {
return &helloAPIClient{cc}
}
func (c *helloAPIClient) Foo(ctx context.Context, in *FooRequest, opts ...grpc.CallOption) (*FooResponse, error) {
out := new(FooResponse)
err := c.cc.Invoke(ctx, "/uber.foo.v1.HelloAPI/Foo", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *helloAPIClient) Bar(ctx context.Context, in *BarRequest, opts ...grpc.CallOption) (*BarResponse, error) {
out := new(BarResponse)
err := c.cc.Invoke(ctx, "/uber.foo.v1.HelloAPI/Bar", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// HelloAPIServer is the server API for HelloAPI service.
type HelloAPIServer interface {
// Foo does a foo.
Foo(context.Context, *FooRequest) (*FooResponse, error)
// Bar does a bar.
Bar(context.Context, *BarRequest) (*BarResponse, error)
}
// UnimplementedHelloAPIServer can be embedded to have forward compatible implementations.
type UnimplementedHelloAPIServer struct {
}
func (*UnimplementedHelloAPIServer) Foo(ctx context.Context, req *FooRequest) (*FooResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Foo not implemented")
}
func (*UnimplementedHelloAPIServer) Bar(ctx context.Context, req *BarRequest) (*BarResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Bar not implemented")
}
func RegisterHelloAPIServer(s *grpc.Server, srv HelloAPIServer) {
s.RegisterService(&_HelloAPI_serviceDesc, srv)
}
func _HelloAPI_Foo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FooRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HelloAPIServer).Foo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/uber.foo.v1.HelloAPI/Foo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HelloAPIServer).Foo(ctx, req.(*FooRequest))
}
return interceptor(ctx, in, info, handler)
}
func _HelloAPI_Bar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BarRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HelloAPIServer).Bar(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/uber.foo.v1.HelloAPI/Bar",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HelloAPIServer).Bar(ctx, req.(*BarRequest))
}
return interceptor(ctx, in, info, handler)
}
var _HelloAPI_serviceDesc = grpc.ServiceDesc{
ServiceName: "uber.foo.v1.HelloAPI",
HandlerType: (*HelloAPIServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Foo",
Handler: _HelloAPI_Foo_Handler,
},
{
MethodName: "Bar",
Handler: _HelloAPI_Bar_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "uber/foo/v1/hello_api.proto",
}