-
Notifications
You must be signed in to change notification settings - Fork 179
/
ghost.pb.go
337 lines (292 loc) · 11.6 KB
/
ghost.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
328
329
330
331
332
333
334
335
336
337
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: ghost.proto
package ghost
import (
context "context"
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
empty "github.com/golang/protobuf/ptypes/empty"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// 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 SubscribeRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SubscribeRequest) Reset() { *m = SubscribeRequest{} }
func (m *SubscribeRequest) String() string { return proto.CompactTextString(m) }
func (*SubscribeRequest) ProtoMessage() {}
func (*SubscribeRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_77edc9f77fb63d46, []int{0}
}
func (m *SubscribeRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SubscribeRequest.Unmarshal(m, b)
}
func (m *SubscribeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SubscribeRequest.Marshal(b, m, deterministic)
}
func (m *SubscribeRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SubscribeRequest.Merge(m, src)
}
func (m *SubscribeRequest) XXX_Size() int {
return xxx_messageInfo_SubscribeRequest.Size(m)
}
func (m *SubscribeRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SubscribeRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SubscribeRequest proto.InternalMessageInfo
type SendEventRequest struct {
ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
Message []byte `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
TargetID [][]byte `protobuf:"bytes,3,rep,name=targetID,proto3" json:"targetID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SendEventRequest) Reset() { *m = SendEventRequest{} }
func (m *SendEventRequest) String() string { return proto.CompactTextString(m) }
func (*SendEventRequest) ProtoMessage() {}
func (*SendEventRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_77edc9f77fb63d46, []int{1}
}
func (m *SendEventRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SendEventRequest.Unmarshal(m, b)
}
func (m *SendEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SendEventRequest.Marshal(b, m, deterministic)
}
func (m *SendEventRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SendEventRequest.Merge(m, src)
}
func (m *SendEventRequest) XXX_Size() int {
return xxx_messageInfo_SendEventRequest.Size(m)
}
func (m *SendEventRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SendEventRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SendEventRequest proto.InternalMessageInfo
func (m *SendEventRequest) GetChannelId() string {
if m != nil {
return m.ChannelId
}
return ""
}
func (m *SendEventRequest) GetMessage() []byte {
if m != nil {
return m.Message
}
return nil
}
func (m *SendEventRequest) GetTargetID() [][]byte {
if m != nil {
return m.TargetID
}
return nil
}
type FlowMessage struct {
SenderID []byte `protobuf:"bytes,1,opt,name=senderID,proto3" json:"senderID,omitempty"`
Message []byte `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FlowMessage) Reset() { *m = FlowMessage{} }
func (m *FlowMessage) String() string { return proto.CompactTextString(m) }
func (*FlowMessage) ProtoMessage() {}
func (*FlowMessage) Descriptor() ([]byte, []int) {
return fileDescriptor_77edc9f77fb63d46, []int{2}
}
func (m *FlowMessage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FlowMessage.Unmarshal(m, b)
}
func (m *FlowMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FlowMessage.Marshal(b, m, deterministic)
}
func (m *FlowMessage) XXX_Merge(src proto.Message) {
xxx_messageInfo_FlowMessage.Merge(m, src)
}
func (m *FlowMessage) XXX_Size() int {
return xxx_messageInfo_FlowMessage.Size(m)
}
func (m *FlowMessage) XXX_DiscardUnknown() {
xxx_messageInfo_FlowMessage.DiscardUnknown(m)
}
var xxx_messageInfo_FlowMessage proto.InternalMessageInfo
func (m *FlowMessage) GetSenderID() []byte {
if m != nil {
return m.SenderID
}
return nil
}
func (m *FlowMessage) GetMessage() []byte {
if m != nil {
return m.Message
}
return nil
}
func init() {
proto.RegisterType((*SubscribeRequest)(nil), "ghost.SubscribeRequest")
proto.RegisterType((*SendEventRequest)(nil), "ghost.SendEventRequest")
proto.RegisterType((*FlowMessage)(nil), "ghost.FlowMessage")
}
func init() { proto.RegisterFile("ghost.proto", fileDescriptor_77edc9f77fb63d46) }
var fileDescriptor_77edc9f77fb63d46 = []byte{
// 257 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xcd, 0x4a, 0xc3, 0x40,
0x10, 0xc7, 0x59, 0x8b, 0x1f, 0x99, 0xe6, 0x50, 0xe6, 0xa0, 0x21, 0x22, 0x84, 0x9c, 0x72, 0xda,
0x8a, 0xde, 0xc4, 0x8b, 0xd8, 0x2a, 0x39, 0x28, 0xb2, 0x7d, 0x00, 0x49, 0xba, 0xe3, 0xb6, 0x90,
0xee, 0xd6, 0xec, 0x46, 0xf1, 0x0d, 0x7c, 0x6c, 0x69, 0x92, 0x6e, 0xa5, 0xd0, 0xe3, 0xef, 0xbf,
0xb3, 0xf3, 0xf1, 0x83, 0xa1, 0x5a, 0x18, 0xeb, 0xf8, 0xba, 0x36, 0xce, 0xe0, 0x71, 0x0b, 0xf1,
0xa5, 0x32, 0x46, 0x55, 0x34, 0x6e, 0xc3, 0xb2, 0xf9, 0x18, 0xd3, 0x6a, 0xed, 0x7e, 0xba, 0x9a,
0x14, 0x61, 0x34, 0x6b, 0x4a, 0x3b, 0xaf, 0x97, 0x25, 0x09, 0xfa, 0x6c, 0xc8, 0xba, 0x54, 0xc1,
0x68, 0x46, 0x5a, 0x4e, 0xbf, 0x48, 0xbb, 0x3e, 0xc3, 0x2b, 0x80, 0xf9, 0xa2, 0xd0, 0x9a, 0xaa,
0xf7, 0xa5, 0x8c, 0x58, 0xc2, 0xb2, 0x40, 0x04, 0x7d, 0x92, 0x4b, 0x8c, 0xe0, 0x74, 0x45, 0xd6,
0x16, 0x8a, 0xa2, 0xa3, 0x84, 0x65, 0xa1, 0xd8, 0x22, 0xc6, 0x70, 0xe6, 0x8a, 0x5a, 0x91, 0xcb,
0x27, 0xd1, 0x20, 0x19, 0x64, 0xa1, 0xf0, 0x9c, 0x3e, 0xc2, 0xf0, 0xa9, 0x32, 0xdf, 0x2f, 0xbb,
0x52, 0x4b, 0x5a, 0x52, 0x9d, 0x4f, 0xda, 0x09, 0xa1, 0xf0, 0x7c, 0x78, 0xc0, 0xcd, 0x2f, 0x83,
0xf0, 0x79, 0x73, 0xe8, 0xab, 0x91, 0xf4, 0xf0, 0x96, 0xe3, 0x3d, 0x04, 0x7e, 0x7d, 0xbc, 0xe0,
0x9d, 0x91, 0xfd, 0x83, 0xe2, 0x73, 0xde, 0x69, 0xe1, 0x5b, 0x2d, 0x7c, 0xba, 0xd1, 0x82, 0x77,
0x10, 0x78, 0x21, 0xbb, 0xdf, 0x7b, 0x8a, 0x62, 0xec, 0x1f, 0xfe, 0xad, 0x7f, 0xcd, 0xca, 0x93,
0xb6, 0xd7, 0xed, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x2b, 0x26, 0xce, 0x86, 0x01, 0x00,
0x00,
}
// 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
// GhostNodeAPIClient is the client API for GhostNodeAPI service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type GhostNodeAPIClient interface {
// SendEvent submits and event to the internal Flow Libp2p network
SendEvent(ctx context.Context, in *SendEventRequest, opts ...grpc.CallOption) (*empty.Empty, error)
// Subscribe returns all network messages
Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (GhostNodeAPI_SubscribeClient, error)
}
type ghostNodeAPIClient struct {
cc *grpc.ClientConn
}
func NewGhostNodeAPIClient(cc *grpc.ClientConn) GhostNodeAPIClient {
return &ghostNodeAPIClient{cc}
}
func (c *ghostNodeAPIClient) SendEvent(ctx context.Context, in *SendEventRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/ghost.GhostNodeAPI/SendEvent", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *ghostNodeAPIClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (GhostNodeAPI_SubscribeClient, error) {
stream, err := c.cc.NewStream(ctx, &_GhostNodeAPI_serviceDesc.Streams[0], "/ghost.GhostNodeAPI/Subscribe", opts...)
if err != nil {
return nil, err
}
x := &ghostNodeAPISubscribeClient{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 GhostNodeAPI_SubscribeClient interface {
Recv() (*FlowMessage, error)
grpc.ClientStream
}
type ghostNodeAPISubscribeClient struct {
grpc.ClientStream
}
func (x *ghostNodeAPISubscribeClient) Recv() (*FlowMessage, error) {
m := new(FlowMessage)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// GhostNodeAPIServer is the server API for GhostNodeAPI service.
type GhostNodeAPIServer interface {
// SendEvent submits and event to the internal Flow Libp2p network
SendEvent(context.Context, *SendEventRequest) (*empty.Empty, error)
// Subscribe returns all network messages
Subscribe(*SubscribeRequest, GhostNodeAPI_SubscribeServer) error
}
// UnimplementedGhostNodeAPIServer can be embedded to have forward compatible implementations.
type UnimplementedGhostNodeAPIServer struct {
}
func (*UnimplementedGhostNodeAPIServer) SendEvent(ctx context.Context, req *SendEventRequest) (*empty.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendEvent not implemented")
}
func (*UnimplementedGhostNodeAPIServer) Subscribe(req *SubscribeRequest, srv GhostNodeAPI_SubscribeServer) error {
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
}
func RegisterGhostNodeAPIServer(s *grpc.Server, srv GhostNodeAPIServer) {
s.RegisterService(&_GhostNodeAPI_serviceDesc, srv)
}
func _GhostNodeAPI_SendEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendEventRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GhostNodeAPIServer).SendEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ghost.GhostNodeAPI/SendEvent",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GhostNodeAPIServer).SendEvent(ctx, req.(*SendEventRequest))
}
return interceptor(ctx, in, info, handler)
}
func _GhostNodeAPI_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(SubscribeRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(GhostNodeAPIServer).Subscribe(m, &ghostNodeAPISubscribeServer{stream})
}
type GhostNodeAPI_SubscribeServer interface {
Send(*FlowMessage) error
grpc.ServerStream
}
type ghostNodeAPISubscribeServer struct {
grpc.ServerStream
}
func (x *ghostNodeAPISubscribeServer) Send(m *FlowMessage) error {
return x.ServerStream.SendMsg(m)
}
var _GhostNodeAPI_serviceDesc = grpc.ServiceDesc{
ServiceName: "ghost.GhostNodeAPI",
HandlerType: (*GhostNodeAPIServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SendEvent",
Handler: _GhostNodeAPI_SendEvent_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Subscribe",
Handler: _GhostNodeAPI_Subscribe_Handler,
ServerStreams: true,
},
},
Metadata: "ghost.proto",
}