-
Notifications
You must be signed in to change notification settings - Fork 3
/
resource_file_service_grpc.pb.go
306 lines (281 loc) · 11.1 KB
/
resource_file_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
296
297
298
299
300
301
302
303
304
305
306
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v4.24.4
// source: api/resource/file/resource_file_service.proto
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
const (
File_GetFile_FullMethodName = "/resource.api.resource.file.v1.File/GetFile"
File_ListFile_FullMethodName = "/resource.api.resource.file.v1.File/ListFile"
File_PrepareUploadFile_FullMethodName = "/resource.api.resource.file.v1.File/PrepareUploadFile"
File_UploadFile_FullMethodName = "/resource.api.resource.file.v1.File/UploadFile"
File_UpdateFile_FullMethodName = "/resource.api.resource.file.v1.File/UpdateFile"
File_DeleteFile_FullMethodName = "/resource.api.resource.file.v1.File/DeleteFile"
)
// FileClient is the client API for File 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 FileClient interface {
// GetFile 获取指定的文件信息
GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (*GetFileReply, error)
// ListFile 获取文件信息列表
ListFile(ctx context.Context, in *ListFileRequest, opts ...grpc.CallOption) (*ListFileReply, error)
// PrepareUploadFile 预上传文件信息
PrepareUploadFile(ctx context.Context, in *PrepareUploadFileRequest, opts ...grpc.CallOption) (*PrepareUploadFileReply, error)
// UploadFile 上传文件
UploadFile(ctx context.Context, in *UploadFileRequest, opts ...grpc.CallOption) (*UploadFileReply, error)
// UpdateFile 更新文件信息
UpdateFile(ctx context.Context, in *UpdateFileRequest, opts ...grpc.CallOption) (*UpdateFileReply, error)
// DeleteFile 删除文件信息
DeleteFile(ctx context.Context, in *DeleteFileRequest, opts ...grpc.CallOption) (*DeleteFileReply, error)
}
type fileClient struct {
cc grpc.ClientConnInterface
}
func NewFileClient(cc grpc.ClientConnInterface) FileClient {
return &fileClient{cc}
}
func (c *fileClient) GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (*GetFileReply, error) {
out := new(GetFileReply)
err := c.cc.Invoke(ctx, File_GetFile_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *fileClient) ListFile(ctx context.Context, in *ListFileRequest, opts ...grpc.CallOption) (*ListFileReply, error) {
out := new(ListFileReply)
err := c.cc.Invoke(ctx, File_ListFile_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *fileClient) PrepareUploadFile(ctx context.Context, in *PrepareUploadFileRequest, opts ...grpc.CallOption) (*PrepareUploadFileReply, error) {
out := new(PrepareUploadFileReply)
err := c.cc.Invoke(ctx, File_PrepareUploadFile_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *fileClient) UploadFile(ctx context.Context, in *UploadFileRequest, opts ...grpc.CallOption) (*UploadFileReply, error) {
out := new(UploadFileReply)
err := c.cc.Invoke(ctx, File_UploadFile_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *fileClient) UpdateFile(ctx context.Context, in *UpdateFileRequest, opts ...grpc.CallOption) (*UpdateFileReply, error) {
out := new(UpdateFileReply)
err := c.cc.Invoke(ctx, File_UpdateFile_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *fileClient) DeleteFile(ctx context.Context, in *DeleteFileRequest, opts ...grpc.CallOption) (*DeleteFileReply, error) {
out := new(DeleteFileReply)
err := c.cc.Invoke(ctx, File_DeleteFile_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// FileServer is the server API for File service.
// All implementations must embed UnimplementedFileServer
// for forward compatibility
type FileServer interface {
// GetFile 获取指定的文件信息
GetFile(context.Context, *GetFileRequest) (*GetFileReply, error)
// ListFile 获取文件信息列表
ListFile(context.Context, *ListFileRequest) (*ListFileReply, error)
// PrepareUploadFile 预上传文件信息
PrepareUploadFile(context.Context, *PrepareUploadFileRequest) (*PrepareUploadFileReply, error)
// UploadFile 上传文件
UploadFile(context.Context, *UploadFileRequest) (*UploadFileReply, error)
// UpdateFile 更新文件信息
UpdateFile(context.Context, *UpdateFileRequest) (*UpdateFileReply, error)
// DeleteFile 删除文件信息
DeleteFile(context.Context, *DeleteFileRequest) (*DeleteFileReply, error)
mustEmbedUnimplementedFileServer()
}
// UnimplementedFileServer must be embedded to have forward compatible implementations.
type UnimplementedFileServer struct {
}
func (UnimplementedFileServer) GetFile(context.Context, *GetFileRequest) (*GetFileReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetFile not implemented")
}
func (UnimplementedFileServer) ListFile(context.Context, *ListFileRequest) (*ListFileReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListFile not implemented")
}
func (UnimplementedFileServer) PrepareUploadFile(context.Context, *PrepareUploadFileRequest) (*PrepareUploadFileReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method PrepareUploadFile not implemented")
}
func (UnimplementedFileServer) UploadFile(context.Context, *UploadFileRequest) (*UploadFileReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method UploadFile not implemented")
}
func (UnimplementedFileServer) UpdateFile(context.Context, *UpdateFileRequest) (*UpdateFileReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateFile not implemented")
}
func (UnimplementedFileServer) DeleteFile(context.Context, *DeleteFileRequest) (*DeleteFileReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteFile not implemented")
}
func (UnimplementedFileServer) mustEmbedUnimplementedFileServer() {}
// UnsafeFileServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to FileServer will
// result in compilation errors.
type UnsafeFileServer interface {
mustEmbedUnimplementedFileServer()
}
func RegisterFileServer(s grpc.ServiceRegistrar, srv FileServer) {
s.RegisterService(&File_ServiceDesc, srv)
}
func _File_GetFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FileServer).GetFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: File_GetFile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FileServer).GetFile(ctx, req.(*GetFileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _File_ListFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FileServer).ListFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: File_ListFile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FileServer).ListFile(ctx, req.(*ListFileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _File_PrepareUploadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PrepareUploadFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FileServer).PrepareUploadFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: File_PrepareUploadFile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FileServer).PrepareUploadFile(ctx, req.(*PrepareUploadFileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _File_UploadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UploadFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FileServer).UploadFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: File_UploadFile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FileServer).UploadFile(ctx, req.(*UploadFileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _File_UpdateFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FileServer).UpdateFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: File_UpdateFile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FileServer).UpdateFile(ctx, req.(*UpdateFileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _File_DeleteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FileServer).DeleteFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: File_DeleteFile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FileServer).DeleteFile(ctx, req.(*DeleteFileRequest))
}
return interceptor(ctx, in, info, handler)
}
// File_ServiceDesc is the grpc.ServiceDesc for File service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var File_ServiceDesc = grpc.ServiceDesc{
ServiceName: "resource.api.resource.file.v1.File",
HandlerType: (*FileServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetFile",
Handler: _File_GetFile_Handler,
},
{
MethodName: "ListFile",
Handler: _File_ListFile_Handler,
},
{
MethodName: "PrepareUploadFile",
Handler: _File_PrepareUploadFile_Handler,
},
{
MethodName: "UploadFile",
Handler: _File_UploadFile_Handler,
},
{
MethodName: "UpdateFile",
Handler: _File_UpdateFile_Handler,
},
{
MethodName: "DeleteFile",
Handler: _File_DeleteFile_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/resource/file/resource_file_service.proto",
}