-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhello.pb.go
More file actions
302 lines (261 loc) · 9.27 KB
/
hello.pb.go
File metadata and controls
302 lines (261 loc) · 9.27 KB
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
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: hello.proto
package main
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 Empty struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Empty) Reset() { *m = Empty{} }
func (m *Empty) String() string { return proto.CompactTextString(m) }
func (*Empty) ProtoMessage() {}
func (*Empty) Descriptor() ([]byte, []int) {
return fileDescriptor_61ef911816e0a8ce, []int{0}
}
func (m *Empty) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Empty.Unmarshal(m, b)
}
func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Empty.Marshal(b, m, deterministic)
}
func (m *Empty) XXX_Merge(src proto.Message) {
xxx_messageInfo_Empty.Merge(m, src)
}
func (m *Empty) XXX_Size() int {
return xxx_messageInfo_Empty.Size(m)
}
func (m *Empty) XXX_DiscardUnknown() {
xxx_messageInfo_Empty.DiscardUnknown(m)
}
var xxx_messageInfo_Empty proto.InternalMessageInfo
type Greeting struct {
Message *string `protobuf:"bytes,1,req,name=message" json:"message,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Greeting) Reset() { *m = Greeting{} }
func (m *Greeting) String() string { return proto.CompactTextString(m) }
func (*Greeting) ProtoMessage() {}
func (*Greeting) Descriptor() ([]byte, []int) {
return fileDescriptor_61ef911816e0a8ce, []int{1}
}
func (m *Greeting) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Greeting.Unmarshal(m, b)
}
func (m *Greeting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Greeting.Marshal(b, m, deterministic)
}
func (m *Greeting) XXX_Merge(src proto.Message) {
xxx_messageInfo_Greeting.Merge(m, src)
}
func (m *Greeting) XXX_Size() int {
return xxx_messageInfo_Greeting.Size(m)
}
func (m *Greeting) XXX_DiscardUnknown() {
xxx_messageInfo_Greeting.DiscardUnknown(m)
}
var xxx_messageInfo_Greeting proto.InternalMessageInfo
func (m *Greeting) GetMessage() string {
if m != nil && m.Message != nil {
return *m.Message
}
return ""
}
type Time struct {
Timestamp *string `protobuf:"bytes,1,req,name=timestamp" json:"timestamp,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Time) Reset() { *m = Time{} }
func (m *Time) String() string { return proto.CompactTextString(m) }
func (*Time) ProtoMessage() {}
func (*Time) Descriptor() ([]byte, []int) {
return fileDescriptor_61ef911816e0a8ce, []int{2}
}
func (m *Time) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Time.Unmarshal(m, b)
}
func (m *Time) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Time.Marshal(b, m, deterministic)
}
func (m *Time) XXX_Merge(src proto.Message) {
xxx_messageInfo_Time.Merge(m, src)
}
func (m *Time) XXX_Size() int {
return xxx_messageInfo_Time.Size(m)
}
func (m *Time) XXX_DiscardUnknown() {
xxx_messageInfo_Time.DiscardUnknown(m)
}
var xxx_messageInfo_Time proto.InternalMessageInfo
func (m *Time) GetTimestamp() string {
if m != nil && m.Timestamp != nil {
return *m.Timestamp
}
return ""
}
func init() {
proto.RegisterType((*Empty)(nil), "Empty")
proto.RegisterType((*Greeting)(nil), "Greeting")
proto.RegisterType((*Time)(nil), "Time")
}
func init() {
proto.RegisterFile("hello.proto", fileDescriptor_61ef911816e0a8ce)
}
var fileDescriptor_61ef911816e0a8ce = []byte{
// 157 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xce, 0x48, 0xcd, 0xc9,
0xc9, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x57, 0x62, 0xe7, 0x62, 0x75, 0xcd, 0x2d, 0x28, 0xa9,
0x54, 0x52, 0xe1, 0xe2, 0x70, 0x2f, 0x4a, 0x4d, 0x2d, 0xc9, 0xcc, 0x4b, 0x17, 0x92, 0xe0, 0x62,
0xcf, 0x4d, 0x2d, 0x2e, 0x4e, 0x4c, 0x4f, 0x95, 0x60, 0x54, 0x60, 0xd2, 0xe0, 0x0c, 0x82, 0x71,
0x95, 0x54, 0xb8, 0x58, 0x42, 0x32, 0x73, 0x53, 0x85, 0x64, 0xb8, 0x38, 0x4b, 0x32, 0x73, 0x53,
0x8b, 0x4b, 0x12, 0x73, 0x0b, 0xa0, 0x6a, 0x10, 0x02, 0x46, 0xce, 0x5c, 0xdc, 0xbe, 0x89, 0x99,
0x79, 0xc1, 0xa9, 0x45, 0x65, 0x99, 0xc9, 0xa9, 0x42, 0x52, 0x5c, 0xac, 0x1e, 0x20, 0x2b, 0x85,
0xd8, 0xf4, 0xc0, 0x76, 0x49, 0x71, 0xea, 0x21, 0x59, 0xc5, 0xea, 0x9c, 0x93, 0x9f, 0x9c, 0x0d,
0x97, 0x63, 0xd5, 0x03, 0x59, 0x60, 0xc0, 0xe8, 0xc4, 0x16, 0xc5, 0x92, 0x9b, 0x98, 0x99, 0x07,
0x08, 0x00, 0x00, 0xff, 0xff, 0x51, 0x37, 0x28, 0xa0, 0xaf, 0x00, 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
// MainServiceClient is the client API for MainService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type MainServiceClient interface {
Hello(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Greeting, error)
Clock(ctx context.Context, in *Empty, opts ...grpc.CallOption) (MainService_ClockClient, error)
}
type mainServiceClient struct {
cc grpc.ClientConnInterface
}
func NewMainServiceClient(cc grpc.ClientConnInterface) MainServiceClient {
return &mainServiceClient{cc}
}
func (c *mainServiceClient) Hello(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Greeting, error) {
out := new(Greeting)
err := c.cc.Invoke(ctx, "/MainService/Hello", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *mainServiceClient) Clock(ctx context.Context, in *Empty, opts ...grpc.CallOption) (MainService_ClockClient, error) {
stream, err := c.cc.NewStream(ctx, &_MainService_serviceDesc.Streams[0], "/MainService/Clock", opts...)
if err != nil {
return nil, err
}
x := &mainServiceClockClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type MainService_ClockClient interface {
Recv() (*Time, error)
grpc.ClientStream
}
type mainServiceClockClient struct {
grpc.ClientStream
}
func (x *mainServiceClockClient) Recv() (*Time, error) {
m := new(Time)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// MainServiceServer is the server API for MainService service.
type MainServiceServer interface {
Hello(context.Context, *Empty) (*Greeting, error)
Clock(*Empty, MainService_ClockServer) error
}
// UnimplementedMainServiceServer can be embedded to have forward compatible implementations.
type UnimplementedMainServiceServer struct {
}
func (*UnimplementedMainServiceServer) Hello(ctx context.Context, req *Empty) (*Greeting, error) {
return nil, status.Errorf(codes.Unimplemented, "method Hello not implemented")
}
func (*UnimplementedMainServiceServer) Clock(req *Empty, srv MainService_ClockServer) error {
return status.Errorf(codes.Unimplemented, "method Clock not implemented")
}
func RegisterMainServiceServer(s *grpc.Server, srv MainServiceServer) {
s.RegisterService(&_MainService_serviceDesc, srv)
}
func _MainService_Hello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MainServiceServer).Hello(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/MainService/Hello",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MainServiceServer).Hello(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _MainService_Clock_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(Empty)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(MainServiceServer).Clock(m, &mainServiceClockServer{stream})
}
type MainService_ClockServer interface {
Send(*Time) error
grpc.ServerStream
}
type mainServiceClockServer struct {
grpc.ServerStream
}
func (x *mainServiceClockServer) Send(m *Time) error {
return x.ServerStream.SendMsg(m)
}
var _MainService_serviceDesc = grpc.ServiceDesc{
ServiceName: "MainService",
HandlerType: (*MainServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Hello",
Handler: _MainService_Hello_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Clock",
Handler: _MainService_Clock_Handler,
ServerStreams: true,
},
},
Metadata: "hello.proto",
}