forked from uw-labs/proximo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproximo_grpc.pb.go
251 lines (210 loc) · 7.44 KB
/
proximo_grpc.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
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc (unknown)
// source: proximo.proto
package proto
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// MessageSourceClient is the client API for MessageSource service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type MessageSourceClient interface {
Consume(ctx context.Context, opts ...grpc.CallOption) (MessageSource_ConsumeClient, error)
}
type messageSourceClient struct {
cc grpc.ClientConnInterface
}
func NewMessageSourceClient(cc grpc.ClientConnInterface) MessageSourceClient {
return &messageSourceClient{cc}
}
func (c *messageSourceClient) Consume(ctx context.Context, opts ...grpc.CallOption) (MessageSource_ConsumeClient, error) {
stream, err := c.cc.NewStream(ctx, &MessageSource_ServiceDesc.Streams[0], "/proximo.MessageSource/Consume", opts...)
if err != nil {
return nil, err
}
x := &messageSourceConsumeClient{stream}
return x, nil
}
type MessageSource_ConsumeClient interface {
Send(*ConsumerRequest) error
Recv() (*Message, error)
grpc.ClientStream
}
type messageSourceConsumeClient struct {
grpc.ClientStream
}
func (x *messageSourceConsumeClient) Send(m *ConsumerRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *messageSourceConsumeClient) Recv() (*Message, error) {
m := new(Message)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// MessageSourceServer is the server API for MessageSource service.
// All implementations should embed UnimplementedMessageSourceServer
// for forward compatibility
type MessageSourceServer interface {
Consume(MessageSource_ConsumeServer) error
}
// UnimplementedMessageSourceServer should be embedded to have forward compatible implementations.
type UnimplementedMessageSourceServer struct {
}
func (UnimplementedMessageSourceServer) Consume(MessageSource_ConsumeServer) error {
return status.Errorf(codes.Unimplemented, "method Consume not implemented")
}
// UnsafeMessageSourceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MessageSourceServer will
// result in compilation errors.
type UnsafeMessageSourceServer interface {
mustEmbedUnimplementedMessageSourceServer()
}
func RegisterMessageSourceServer(s grpc.ServiceRegistrar, srv MessageSourceServer) {
s.RegisterService(&MessageSource_ServiceDesc, srv)
}
func _MessageSource_Consume_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(MessageSourceServer).Consume(&messageSourceConsumeServer{stream})
}
type MessageSource_ConsumeServer interface {
Send(*Message) error
Recv() (*ConsumerRequest, error)
grpc.ServerStream
}
type messageSourceConsumeServer struct {
grpc.ServerStream
}
func (x *messageSourceConsumeServer) Send(m *Message) error {
return x.ServerStream.SendMsg(m)
}
func (x *messageSourceConsumeServer) Recv() (*ConsumerRequest, error) {
m := new(ConsumerRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// MessageSource_ServiceDesc is the grpc.ServiceDesc for MessageSource service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var MessageSource_ServiceDesc = grpc.ServiceDesc{
ServiceName: "proximo.MessageSource",
HandlerType: (*MessageSourceServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "Consume",
Handler: _MessageSource_Consume_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "proximo.proto",
}
// MessageSinkClient is the client API for MessageSink service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type MessageSinkClient interface {
Publish(ctx context.Context, opts ...grpc.CallOption) (MessageSink_PublishClient, error)
}
type messageSinkClient struct {
cc grpc.ClientConnInterface
}
func NewMessageSinkClient(cc grpc.ClientConnInterface) MessageSinkClient {
return &messageSinkClient{cc}
}
func (c *messageSinkClient) Publish(ctx context.Context, opts ...grpc.CallOption) (MessageSink_PublishClient, error) {
stream, err := c.cc.NewStream(ctx, &MessageSink_ServiceDesc.Streams[0], "/proximo.MessageSink/Publish", opts...)
if err != nil {
return nil, err
}
x := &messageSinkPublishClient{stream}
return x, nil
}
type MessageSink_PublishClient interface {
Send(*PublisherRequest) error
Recv() (*Confirmation, error)
grpc.ClientStream
}
type messageSinkPublishClient struct {
grpc.ClientStream
}
func (x *messageSinkPublishClient) Send(m *PublisherRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *messageSinkPublishClient) Recv() (*Confirmation, error) {
m := new(Confirmation)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// MessageSinkServer is the server API for MessageSink service.
// All implementations should embed UnimplementedMessageSinkServer
// for forward compatibility
type MessageSinkServer interface {
Publish(MessageSink_PublishServer) error
}
// UnimplementedMessageSinkServer should be embedded to have forward compatible implementations.
type UnimplementedMessageSinkServer struct {
}
func (UnimplementedMessageSinkServer) Publish(MessageSink_PublishServer) error {
return status.Errorf(codes.Unimplemented, "method Publish not implemented")
}
// UnsafeMessageSinkServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MessageSinkServer will
// result in compilation errors.
type UnsafeMessageSinkServer interface {
mustEmbedUnimplementedMessageSinkServer()
}
func RegisterMessageSinkServer(s grpc.ServiceRegistrar, srv MessageSinkServer) {
s.RegisterService(&MessageSink_ServiceDesc, srv)
}
func _MessageSink_Publish_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(MessageSinkServer).Publish(&messageSinkPublishServer{stream})
}
type MessageSink_PublishServer interface {
Send(*Confirmation) error
Recv() (*PublisherRequest, error)
grpc.ServerStream
}
type messageSinkPublishServer struct {
grpc.ServerStream
}
func (x *messageSinkPublishServer) Send(m *Confirmation) error {
return x.ServerStream.SendMsg(m)
}
func (x *messageSinkPublishServer) Recv() (*PublisherRequest, error) {
m := new(PublisherRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// MessageSink_ServiceDesc is the grpc.ServiceDesc for MessageSink service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var MessageSink_ServiceDesc = grpc.ServiceDesc{
ServiceName: "proximo.MessageSink",
HandlerType: (*MessageSinkServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "Publish",
Handler: _MessageSink_Publish_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "proximo.proto",
}