forked from pydio/cells
-
Notifications
You must be signed in to change notification settings - Fork 0
/
activitystream.micro.go
373 lines (309 loc) · 11.4 KB
/
activitystream.micro.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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: activitystream.proto
/*
Package activity is a generated protocol buffer package.
It is generated from these files:
activitystream.proto
It has these top-level messages:
Object
PostActivityRequest
PostActivityResponse
PostActivityEvent
StreamActivitiesRequest
StreamActivitiesResponse
Subscription
SubscribeRequest
SubscribeResponse
SearchSubscriptionsRequest
SearchSubscriptionsResponse
UnreadActivitiesRequest
UnreadActivitiesResponse
UserLastActivityRequest
UserLastActivityResponse
*/
package activity
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/golang/protobuf/ptypes/timestamp"
import (
client "github.com/micro/go-micro/client"
server "github.com/micro/go-micro/server"
context "context"
)
// 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
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ client.Option
var _ server.Option
// Client API for ActivityService service
type ActivityServiceClient interface {
PostActivity(ctx context.Context, opts ...client.CallOption) (ActivityService_PostActivityClient, error)
StreamActivities(ctx context.Context, in *StreamActivitiesRequest, opts ...client.CallOption) (ActivityService_StreamActivitiesClient, error)
UnreadActivitiesNumber(ctx context.Context, in *UnreadActivitiesRequest, opts ...client.CallOption) (*UnreadActivitiesResponse, error)
SetUserLastActivity(ctx context.Context, in *UserLastActivityRequest, opts ...client.CallOption) (*UserLastActivityResponse, error)
Subscribe(ctx context.Context, in *SubscribeRequest, opts ...client.CallOption) (*SubscribeResponse, error)
SearchSubscriptions(ctx context.Context, in *SearchSubscriptionsRequest, opts ...client.CallOption) (ActivityService_SearchSubscriptionsClient, error)
}
type activityServiceClient struct {
c client.Client
serviceName string
}
func NewActivityServiceClient(serviceName string, c client.Client) ActivityServiceClient {
if c == nil {
c = client.NewClient()
}
if len(serviceName) == 0 {
serviceName = "activity"
}
return &activityServiceClient{
c: c,
serviceName: serviceName,
}
}
func (c *activityServiceClient) PostActivity(ctx context.Context, opts ...client.CallOption) (ActivityService_PostActivityClient, error) {
req := c.c.NewRequest(c.serviceName, "ActivityService.PostActivity", &PostActivityRequest{})
stream, err := c.c.Stream(ctx, req, opts...)
if err != nil {
return nil, err
}
return &activityServicePostActivityClient{stream}, nil
}
type ActivityService_PostActivityClient interface {
SendMsg(interface{}) error
RecvMsg(interface{}) error
Close() error
Send(*PostActivityRequest) error
}
type activityServicePostActivityClient struct {
stream client.Streamer
}
func (x *activityServicePostActivityClient) Close() error {
return x.stream.Close()
}
func (x *activityServicePostActivityClient) SendMsg(m interface{}) error {
return x.stream.Send(m)
}
func (x *activityServicePostActivityClient) RecvMsg(m interface{}) error {
return x.stream.Recv(m)
}
func (x *activityServicePostActivityClient) Send(m *PostActivityRequest) error {
return x.stream.Send(m)
}
func (c *activityServiceClient) StreamActivities(ctx context.Context, in *StreamActivitiesRequest, opts ...client.CallOption) (ActivityService_StreamActivitiesClient, error) {
req := c.c.NewRequest(c.serviceName, "ActivityService.StreamActivities", &StreamActivitiesRequest{})
stream, err := c.c.Stream(ctx, req, opts...)
if err != nil {
return nil, err
}
if err := stream.Send(in); err != nil {
return nil, err
}
return &activityServiceStreamActivitiesClient{stream}, nil
}
type ActivityService_StreamActivitiesClient interface {
SendMsg(interface{}) error
RecvMsg(interface{}) error
Close() error
Recv() (*StreamActivitiesResponse, error)
}
type activityServiceStreamActivitiesClient struct {
stream client.Streamer
}
func (x *activityServiceStreamActivitiesClient) Close() error {
return x.stream.Close()
}
func (x *activityServiceStreamActivitiesClient) SendMsg(m interface{}) error {
return x.stream.Send(m)
}
func (x *activityServiceStreamActivitiesClient) RecvMsg(m interface{}) error {
return x.stream.Recv(m)
}
func (x *activityServiceStreamActivitiesClient) Recv() (*StreamActivitiesResponse, error) {
m := new(StreamActivitiesResponse)
err := x.stream.Recv(m)
if err != nil {
return nil, err
}
return m, nil
}
func (c *activityServiceClient) UnreadActivitiesNumber(ctx context.Context, in *UnreadActivitiesRequest, opts ...client.CallOption) (*UnreadActivitiesResponse, error) {
req := c.c.NewRequest(c.serviceName, "ActivityService.UnreadActivitiesNumber", in)
out := new(UnreadActivitiesResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *activityServiceClient) SetUserLastActivity(ctx context.Context, in *UserLastActivityRequest, opts ...client.CallOption) (*UserLastActivityResponse, error) {
req := c.c.NewRequest(c.serviceName, "ActivityService.SetUserLastActivity", in)
out := new(UserLastActivityResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *activityServiceClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...client.CallOption) (*SubscribeResponse, error) {
req := c.c.NewRequest(c.serviceName, "ActivityService.Subscribe", in)
out := new(SubscribeResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *activityServiceClient) SearchSubscriptions(ctx context.Context, in *SearchSubscriptionsRequest, opts ...client.CallOption) (ActivityService_SearchSubscriptionsClient, error) {
req := c.c.NewRequest(c.serviceName, "ActivityService.SearchSubscriptions", &SearchSubscriptionsRequest{})
stream, err := c.c.Stream(ctx, req, opts...)
if err != nil {
return nil, err
}
if err := stream.Send(in); err != nil {
return nil, err
}
return &activityServiceSearchSubscriptionsClient{stream}, nil
}
type ActivityService_SearchSubscriptionsClient interface {
SendMsg(interface{}) error
RecvMsg(interface{}) error
Close() error
Recv() (*SearchSubscriptionsResponse, error)
}
type activityServiceSearchSubscriptionsClient struct {
stream client.Streamer
}
func (x *activityServiceSearchSubscriptionsClient) Close() error {
return x.stream.Close()
}
func (x *activityServiceSearchSubscriptionsClient) SendMsg(m interface{}) error {
return x.stream.Send(m)
}
func (x *activityServiceSearchSubscriptionsClient) RecvMsg(m interface{}) error {
return x.stream.Recv(m)
}
func (x *activityServiceSearchSubscriptionsClient) Recv() (*SearchSubscriptionsResponse, error) {
m := new(SearchSubscriptionsResponse)
err := x.stream.Recv(m)
if err != nil {
return nil, err
}
return m, nil
}
// Server API for ActivityService service
type ActivityServiceHandler interface {
PostActivity(context.Context, ActivityService_PostActivityStream) error
StreamActivities(context.Context, *StreamActivitiesRequest, ActivityService_StreamActivitiesStream) error
UnreadActivitiesNumber(context.Context, *UnreadActivitiesRequest, *UnreadActivitiesResponse) error
SetUserLastActivity(context.Context, *UserLastActivityRequest, *UserLastActivityResponse) error
Subscribe(context.Context, *SubscribeRequest, *SubscribeResponse) error
SearchSubscriptions(context.Context, *SearchSubscriptionsRequest, ActivityService_SearchSubscriptionsStream) error
}
func RegisterActivityServiceHandler(s server.Server, hdlr ActivityServiceHandler, opts ...server.HandlerOption) {
s.Handle(s.NewHandler(&ActivityService{hdlr}, opts...))
}
type ActivityService struct {
ActivityServiceHandler
}
func (h *ActivityService) PostActivity(ctx context.Context, stream server.Streamer) error {
return h.ActivityServiceHandler.PostActivity(ctx, &activityServicePostActivityStream{stream})
}
type ActivityService_PostActivityStream interface {
SendMsg(interface{}) error
RecvMsg(interface{}) error
Close() error
Recv() (*PostActivityRequest, error)
}
type activityServicePostActivityStream struct {
stream server.Streamer
}
func (x *activityServicePostActivityStream) Close() error {
return x.stream.Close()
}
func (x *activityServicePostActivityStream) SendMsg(m interface{}) error {
return x.stream.Send(m)
}
func (x *activityServicePostActivityStream) RecvMsg(m interface{}) error {
return x.stream.Recv(m)
}
func (x *activityServicePostActivityStream) Recv() (*PostActivityRequest, error) {
m := new(PostActivityRequest)
if err := x.stream.Recv(m); err != nil {
return nil, err
}
return m, nil
}
func (h *ActivityService) StreamActivities(ctx context.Context, stream server.Streamer) error {
m := new(StreamActivitiesRequest)
if err := stream.Recv(m); err != nil {
return err
}
return h.ActivityServiceHandler.StreamActivities(ctx, m, &activityServiceStreamActivitiesStream{stream})
}
type ActivityService_StreamActivitiesStream interface {
SendMsg(interface{}) error
RecvMsg(interface{}) error
Close() error
Send(*StreamActivitiesResponse) error
}
type activityServiceStreamActivitiesStream struct {
stream server.Streamer
}
func (x *activityServiceStreamActivitiesStream) Close() error {
return x.stream.Close()
}
func (x *activityServiceStreamActivitiesStream) SendMsg(m interface{}) error {
return x.stream.Send(m)
}
func (x *activityServiceStreamActivitiesStream) RecvMsg(m interface{}) error {
return x.stream.Recv(m)
}
func (x *activityServiceStreamActivitiesStream) Send(m *StreamActivitiesResponse) error {
return x.stream.Send(m)
}
func (h *ActivityService) UnreadActivitiesNumber(ctx context.Context, in *UnreadActivitiesRequest, out *UnreadActivitiesResponse) error {
return h.ActivityServiceHandler.UnreadActivitiesNumber(ctx, in, out)
}
func (h *ActivityService) SetUserLastActivity(ctx context.Context, in *UserLastActivityRequest, out *UserLastActivityResponse) error {
return h.ActivityServiceHandler.SetUserLastActivity(ctx, in, out)
}
func (h *ActivityService) Subscribe(ctx context.Context, in *SubscribeRequest, out *SubscribeResponse) error {
return h.ActivityServiceHandler.Subscribe(ctx, in, out)
}
func (h *ActivityService) SearchSubscriptions(ctx context.Context, stream server.Streamer) error {
m := new(SearchSubscriptionsRequest)
if err := stream.Recv(m); err != nil {
return err
}
return h.ActivityServiceHandler.SearchSubscriptions(ctx, m, &activityServiceSearchSubscriptionsStream{stream})
}
type ActivityService_SearchSubscriptionsStream interface {
SendMsg(interface{}) error
RecvMsg(interface{}) error
Close() error
Send(*SearchSubscriptionsResponse) error
}
type activityServiceSearchSubscriptionsStream struct {
stream server.Streamer
}
func (x *activityServiceSearchSubscriptionsStream) Close() error {
return x.stream.Close()
}
func (x *activityServiceSearchSubscriptionsStream) SendMsg(m interface{}) error {
return x.stream.Send(m)
}
func (x *activityServiceSearchSubscriptionsStream) RecvMsg(m interface{}) error {
return x.stream.Recv(m)
}
func (x *activityServiceSearchSubscriptionsStream) Send(m *SearchSubscriptionsResponse) error {
return x.stream.Send(m)
}