-
Notifications
You must be signed in to change notification settings - Fork 40
/
blog_grpc.pb.go
461 lines (427 loc) · 17.9 KB
/
blog_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
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
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package v1
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
// BlogServiceClient is the client API for BlogService 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 BlogServiceClient interface {
SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*SignUpResponse, error)
SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*SignInResponse, error)
CreatePost(ctx context.Context, in *CreatePostRequest, opts ...grpc.CallOption) (*CreatePostResponse, error)
GetPost(ctx context.Context, in *GetPostRequest, opts ...grpc.CallOption) (*GetPostResponse, error)
ListPosts(ctx context.Context, in *ListPostsRequest, opts ...grpc.CallOption) (*ListPostsResponse, error)
UpdatePost(ctx context.Context, in *UpdatePostRequest, opts ...grpc.CallOption) (*UpdatePostResponse, error)
DeletePost(ctx context.Context, in *DeletePostRequest, opts ...grpc.CallOption) (*DeletePostResponse, error)
CreateComment(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*CreateCommentResponse, error)
DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*DeleteCommentResponse, error)
UpdateComment(ctx context.Context, in *UpdateCommentRequest, opts ...grpc.CallOption) (*UpdateCommentResponse, error)
ListCommentsByPostID(ctx context.Context, in *ListCommentsByPostIDRequest, opts ...grpc.CallOption) (*ListCommentsByPostIDResponse, error)
}
type blogServiceClient struct {
cc grpc.ClientConnInterface
}
func NewBlogServiceClient(cc grpc.ClientConnInterface) BlogServiceClient {
return &blogServiceClient{cc}
}
func (c *blogServiceClient) SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*SignUpResponse, error) {
out := new(SignUpResponse)
err := c.cc.Invoke(ctx, "/api.protobuf.blog.v1.BlogService/SignUp", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blogServiceClient) SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*SignInResponse, error) {
out := new(SignInResponse)
err := c.cc.Invoke(ctx, "/api.protobuf.blog.v1.BlogService/SignIn", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blogServiceClient) CreatePost(ctx context.Context, in *CreatePostRequest, opts ...grpc.CallOption) (*CreatePostResponse, error) {
out := new(CreatePostResponse)
err := c.cc.Invoke(ctx, "/api.protobuf.blog.v1.BlogService/CreatePost", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blogServiceClient) GetPost(ctx context.Context, in *GetPostRequest, opts ...grpc.CallOption) (*GetPostResponse, error) {
out := new(GetPostResponse)
err := c.cc.Invoke(ctx, "/api.protobuf.blog.v1.BlogService/GetPost", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blogServiceClient) ListPosts(ctx context.Context, in *ListPostsRequest, opts ...grpc.CallOption) (*ListPostsResponse, error) {
out := new(ListPostsResponse)
err := c.cc.Invoke(ctx, "/api.protobuf.blog.v1.BlogService/ListPosts", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blogServiceClient) UpdatePost(ctx context.Context, in *UpdatePostRequest, opts ...grpc.CallOption) (*UpdatePostResponse, error) {
out := new(UpdatePostResponse)
err := c.cc.Invoke(ctx, "/api.protobuf.blog.v1.BlogService/UpdatePost", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blogServiceClient) DeletePost(ctx context.Context, in *DeletePostRequest, opts ...grpc.CallOption) (*DeletePostResponse, error) {
out := new(DeletePostResponse)
err := c.cc.Invoke(ctx, "/api.protobuf.blog.v1.BlogService/DeletePost", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blogServiceClient) CreateComment(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*CreateCommentResponse, error) {
out := new(CreateCommentResponse)
err := c.cc.Invoke(ctx, "/api.protobuf.blog.v1.BlogService/CreateComment", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blogServiceClient) DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*DeleteCommentResponse, error) {
out := new(DeleteCommentResponse)
err := c.cc.Invoke(ctx, "/api.protobuf.blog.v1.BlogService/DeleteComment", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blogServiceClient) UpdateComment(ctx context.Context, in *UpdateCommentRequest, opts ...grpc.CallOption) (*UpdateCommentResponse, error) {
out := new(UpdateCommentResponse)
err := c.cc.Invoke(ctx, "/api.protobuf.blog.v1.BlogService/UpdateComment", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blogServiceClient) ListCommentsByPostID(ctx context.Context, in *ListCommentsByPostIDRequest, opts ...grpc.CallOption) (*ListCommentsByPostIDResponse, error) {
out := new(ListCommentsByPostIDResponse)
err := c.cc.Invoke(ctx, "/api.protobuf.blog.v1.BlogService/ListCommentsByPostID", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// BlogServiceServer is the server API for BlogService service.
// All implementations must embed UnimplementedBlogServiceServer
// for forward compatibility
type BlogServiceServer interface {
SignUp(context.Context, *SignUpRequest) (*SignUpResponse, error)
SignIn(context.Context, *SignInRequest) (*SignInResponse, error)
CreatePost(context.Context, *CreatePostRequest) (*CreatePostResponse, error)
GetPost(context.Context, *GetPostRequest) (*GetPostResponse, error)
ListPosts(context.Context, *ListPostsRequest) (*ListPostsResponse, error)
UpdatePost(context.Context, *UpdatePostRequest) (*UpdatePostResponse, error)
DeletePost(context.Context, *DeletePostRequest) (*DeletePostResponse, error)
CreateComment(context.Context, *CreateCommentRequest) (*CreateCommentResponse, error)
DeleteComment(context.Context, *DeleteCommentRequest) (*DeleteCommentResponse, error)
UpdateComment(context.Context, *UpdateCommentRequest) (*UpdateCommentResponse, error)
ListCommentsByPostID(context.Context, *ListCommentsByPostIDRequest) (*ListCommentsByPostIDResponse, error)
mustEmbedUnimplementedBlogServiceServer()
}
// UnimplementedBlogServiceServer must be embedded to have forward compatible implementations.
type UnimplementedBlogServiceServer struct {
}
func (UnimplementedBlogServiceServer) SignUp(context.Context, *SignUpRequest) (*SignUpResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SignUp not implemented")
}
func (UnimplementedBlogServiceServer) SignIn(context.Context, *SignInRequest) (*SignInResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SignIn not implemented")
}
func (UnimplementedBlogServiceServer) CreatePost(context.Context, *CreatePostRequest) (*CreatePostResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreatePost not implemented")
}
func (UnimplementedBlogServiceServer) GetPost(context.Context, *GetPostRequest) (*GetPostResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPost not implemented")
}
func (UnimplementedBlogServiceServer) ListPosts(context.Context, *ListPostsRequest) (*ListPostsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListPosts not implemented")
}
func (UnimplementedBlogServiceServer) UpdatePost(context.Context, *UpdatePostRequest) (*UpdatePostResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdatePost not implemented")
}
func (UnimplementedBlogServiceServer) DeletePost(context.Context, *DeletePostRequest) (*DeletePostResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeletePost not implemented")
}
func (UnimplementedBlogServiceServer) CreateComment(context.Context, *CreateCommentRequest) (*CreateCommentResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateComment not implemented")
}
func (UnimplementedBlogServiceServer) DeleteComment(context.Context, *DeleteCommentRequest) (*DeleteCommentResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteComment not implemented")
}
func (UnimplementedBlogServiceServer) UpdateComment(context.Context, *UpdateCommentRequest) (*UpdateCommentResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateComment not implemented")
}
func (UnimplementedBlogServiceServer) ListCommentsByPostID(context.Context, *ListCommentsByPostIDRequest) (*ListCommentsByPostIDResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListCommentsByPostID not implemented")
}
func (UnimplementedBlogServiceServer) mustEmbedUnimplementedBlogServiceServer() {}
// UnsafeBlogServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BlogServiceServer will
// result in compilation errors.
type UnsafeBlogServiceServer interface {
mustEmbedUnimplementedBlogServiceServer()
}
func RegisterBlogServiceServer(s grpc.ServiceRegistrar, srv BlogServiceServer) {
s.RegisterService(&BlogService_ServiceDesc, srv)
}
func _BlogService_SignUp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SignUpRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).SignUp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.protobuf.blog.v1.BlogService/SignUp",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).SignUp(ctx, req.(*SignUpRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlogService_SignIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SignInRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).SignIn(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.protobuf.blog.v1.BlogService/SignIn",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).SignIn(ctx, req.(*SignInRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlogService_CreatePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreatePostRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).CreatePost(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.protobuf.blog.v1.BlogService/CreatePost",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).CreatePost(ctx, req.(*CreatePostRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlogService_GetPost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetPostRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).GetPost(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.protobuf.blog.v1.BlogService/GetPost",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).GetPost(ctx, req.(*GetPostRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlogService_ListPosts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListPostsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).ListPosts(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.protobuf.blog.v1.BlogService/ListPosts",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).ListPosts(ctx, req.(*ListPostsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlogService_UpdatePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdatePostRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).UpdatePost(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.protobuf.blog.v1.BlogService/UpdatePost",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).UpdatePost(ctx, req.(*UpdatePostRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlogService_DeletePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeletePostRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).DeletePost(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.protobuf.blog.v1.BlogService/DeletePost",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).DeletePost(ctx, req.(*DeletePostRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlogService_CreateComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateCommentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).CreateComment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.protobuf.blog.v1.BlogService/CreateComment",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).CreateComment(ctx, req.(*CreateCommentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlogService_DeleteComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteCommentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).DeleteComment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.protobuf.blog.v1.BlogService/DeleteComment",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).DeleteComment(ctx, req.(*DeleteCommentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlogService_UpdateComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateCommentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).UpdateComment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.protobuf.blog.v1.BlogService/UpdateComment",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).UpdateComment(ctx, req.(*UpdateCommentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlogService_ListCommentsByPostID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListCommentsByPostIDRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).ListCommentsByPostID(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.protobuf.blog.v1.BlogService/ListCommentsByPostID",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).ListCommentsByPostID(ctx, req.(*ListCommentsByPostIDRequest))
}
return interceptor(ctx, in, info, handler)
}
// BlogService_ServiceDesc is the grpc.ServiceDesc for BlogService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BlogService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "api.protobuf.blog.v1.BlogService",
HandlerType: (*BlogServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SignUp",
Handler: _BlogService_SignUp_Handler,
},
{
MethodName: "SignIn",
Handler: _BlogService_SignIn_Handler,
},
{
MethodName: "CreatePost",
Handler: _BlogService_CreatePost_Handler,
},
{
MethodName: "GetPost",
Handler: _BlogService_GetPost_Handler,
},
{
MethodName: "ListPosts",
Handler: _BlogService_ListPosts_Handler,
},
{
MethodName: "UpdatePost",
Handler: _BlogService_UpdatePost_Handler,
},
{
MethodName: "DeletePost",
Handler: _BlogService_DeletePost_Handler,
},
{
MethodName: "CreateComment",
Handler: _BlogService_CreateComment_Handler,
},
{
MethodName: "DeleteComment",
Handler: _BlogService_DeleteComment_Handler,
},
{
MethodName: "UpdateComment",
Handler: _BlogService_UpdateComment_Handler,
},
{
MethodName: "ListCommentsByPostID",
Handler: _BlogService_ListCommentsByPostID_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/protobuf/blog/v1/blog.proto",
}