-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
service_grpc.pb.go
295 lines (271 loc) · 11.3 KB
/
service_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
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc (unknown)
// source: acme/book/v1/service.proto
package bookv1
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
// BookServiceClient is the client API for BookService 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 BookServiceClient interface {
// ListBooks retrieves a list of book resources from the server.
ListBooks(ctx context.Context, in *ListBooksRequest, opts ...grpc.CallOption) (*ListBooksResponse, error)
// BatchGetBooks retrieves multiple book resources from the server.
BatchGetBooks(ctx context.Context, in *BatchGetBooksRequest, opts ...grpc.CallOption) (*BatchGetBooksResponse, error)
// GetBook retrieves a single book resource from the server.
GetBook(ctx context.Context, in *GetBookRequest, opts ...grpc.CallOption) (*GetBookResponse, error)
// CreateBook creates a new book resource on the server.
CreateBook(ctx context.Context, in *CreateBookRequest, opts ...grpc.CallOption) (*CreateBookResponse, error)
// UpdateBook updates the book resource on the server.
UpdateBook(ctx context.Context, in *UpdateBookRequest, opts ...grpc.CallOption) (*UpdateBookResponse, error)
// DeleteBook deletes the book resource from the server.
DeleteBook(ctx context.Context, in *DeleteBookRequest, opts ...grpc.CallOption) (*DeleteBookResponse, error)
}
type bookServiceClient struct {
cc grpc.ClientConnInterface
}
func NewBookServiceClient(cc grpc.ClientConnInterface) BookServiceClient {
return &bookServiceClient{cc}
}
func (c *bookServiceClient) ListBooks(ctx context.Context, in *ListBooksRequest, opts ...grpc.CallOption) (*ListBooksResponse, error) {
out := new(ListBooksResponse)
err := c.cc.Invoke(ctx, "/acme.book.v1.BookService/ListBooks", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bookServiceClient) BatchGetBooks(ctx context.Context, in *BatchGetBooksRequest, opts ...grpc.CallOption) (*BatchGetBooksResponse, error) {
out := new(BatchGetBooksResponse)
err := c.cc.Invoke(ctx, "/acme.book.v1.BookService/BatchGetBooks", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bookServiceClient) GetBook(ctx context.Context, in *GetBookRequest, opts ...grpc.CallOption) (*GetBookResponse, error) {
out := new(GetBookResponse)
err := c.cc.Invoke(ctx, "/acme.book.v1.BookService/GetBook", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bookServiceClient) CreateBook(ctx context.Context, in *CreateBookRequest, opts ...grpc.CallOption) (*CreateBookResponse, error) {
out := new(CreateBookResponse)
err := c.cc.Invoke(ctx, "/acme.book.v1.BookService/CreateBook", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bookServiceClient) UpdateBook(ctx context.Context, in *UpdateBookRequest, opts ...grpc.CallOption) (*UpdateBookResponse, error) {
out := new(UpdateBookResponse)
err := c.cc.Invoke(ctx, "/acme.book.v1.BookService/UpdateBook", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bookServiceClient) DeleteBook(ctx context.Context, in *DeleteBookRequest, opts ...grpc.CallOption) (*DeleteBookResponse, error) {
out := new(DeleteBookResponse)
err := c.cc.Invoke(ctx, "/acme.book.v1.BookService/DeleteBook", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// BookServiceServer is the server API for BookService service.
// All implementations should embed UnimplementedBookServiceServer
// for forward compatibility
type BookServiceServer interface {
// ListBooks retrieves a list of book resources from the server.
ListBooks(context.Context, *ListBooksRequest) (*ListBooksResponse, error)
// BatchGetBooks retrieves multiple book resources from the server.
BatchGetBooks(context.Context, *BatchGetBooksRequest) (*BatchGetBooksResponse, error)
// GetBook retrieves a single book resource from the server.
GetBook(context.Context, *GetBookRequest) (*GetBookResponse, error)
// CreateBook creates a new book resource on the server.
CreateBook(context.Context, *CreateBookRequest) (*CreateBookResponse, error)
// UpdateBook updates the book resource on the server.
UpdateBook(context.Context, *UpdateBookRequest) (*UpdateBookResponse, error)
// DeleteBook deletes the book resource from the server.
DeleteBook(context.Context, *DeleteBookRequest) (*DeleteBookResponse, error)
}
// UnimplementedBookServiceServer should be embedded to have forward compatible implementations.
type UnimplementedBookServiceServer struct {
}
func (UnimplementedBookServiceServer) ListBooks(context.Context, *ListBooksRequest) (*ListBooksResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListBooks not implemented")
}
func (UnimplementedBookServiceServer) BatchGetBooks(context.Context, *BatchGetBooksRequest) (*BatchGetBooksResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BatchGetBooks not implemented")
}
func (UnimplementedBookServiceServer) GetBook(context.Context, *GetBookRequest) (*GetBookResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBook not implemented")
}
func (UnimplementedBookServiceServer) CreateBook(context.Context, *CreateBookRequest) (*CreateBookResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateBook not implemented")
}
func (UnimplementedBookServiceServer) UpdateBook(context.Context, *UpdateBookRequest) (*UpdateBookResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateBook not implemented")
}
func (UnimplementedBookServiceServer) DeleteBook(context.Context, *DeleteBookRequest) (*DeleteBookResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteBook not implemented")
}
// UnsafeBookServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BookServiceServer will
// result in compilation errors.
type UnsafeBookServiceServer interface {
mustEmbedUnimplementedBookServiceServer()
}
func RegisterBookServiceServer(s grpc.ServiceRegistrar, srv BookServiceServer) {
s.RegisterService(&BookService_ServiceDesc, srv)
}
func _BookService_ListBooks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListBooksRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BookServiceServer).ListBooks(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/acme.book.v1.BookService/ListBooks",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BookServiceServer).ListBooks(ctx, req.(*ListBooksRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BookService_BatchGetBooks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BatchGetBooksRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BookServiceServer).BatchGetBooks(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/acme.book.v1.BookService/BatchGetBooks",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BookServiceServer).BatchGetBooks(ctx, req.(*BatchGetBooksRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BookService_GetBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetBookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BookServiceServer).GetBook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/acme.book.v1.BookService/GetBook",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BookServiceServer).GetBook(ctx, req.(*GetBookRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BookService_CreateBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateBookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BookServiceServer).CreateBook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/acme.book.v1.BookService/CreateBook",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BookServiceServer).CreateBook(ctx, req.(*CreateBookRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BookService_UpdateBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateBookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BookServiceServer).UpdateBook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/acme.book.v1.BookService/UpdateBook",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BookServiceServer).UpdateBook(ctx, req.(*UpdateBookRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BookService_DeleteBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteBookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BookServiceServer).DeleteBook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/acme.book.v1.BookService/DeleteBook",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BookServiceServer).DeleteBook(ctx, req.(*DeleteBookRequest))
}
return interceptor(ctx, in, info, handler)
}
// BookService_ServiceDesc is the grpc.ServiceDesc for BookService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BookService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "acme.book.v1.BookService",
HandlerType: (*BookServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ListBooks",
Handler: _BookService_ListBooks_Handler,
},
{
MethodName: "BatchGetBooks",
Handler: _BookService_BatchGetBooks_Handler,
},
{
MethodName: "GetBook",
Handler: _BookService_GetBook_Handler,
},
{
MethodName: "CreateBook",
Handler: _BookService_CreateBook_Handler,
},
{
MethodName: "UpdateBook",
Handler: _BookService_UpdateBook_Handler,
},
{
MethodName: "DeleteBook",
Handler: _BookService_DeleteBook_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "acme/book/v1/service.proto",
}