138 lines
4.9 KiB
Go
138 lines
4.9 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
|
|
package pb
|
|
|
|
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
|
|
|
|
// FileServiceClient is the client API for FileService 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 FileServiceClient interface {
|
|
UploadFile(ctx context.Context, in *UploadFileRequest, opts ...grpc.CallOption) (*UploadFileResponse, error)
|
|
GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (*GetFileResponse, error)
|
|
}
|
|
|
|
type fileServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewFileServiceClient(cc grpc.ClientConnInterface) FileServiceClient {
|
|
return &fileServiceClient{cc}
|
|
}
|
|
|
|
func (c *fileServiceClient) UploadFile(ctx context.Context, in *UploadFileRequest, opts ...grpc.CallOption) (*UploadFileResponse, error) {
|
|
out := new(UploadFileResponse)
|
|
err := c.cc.Invoke(ctx, "/ezshare.FileService/UploadFile", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *fileServiceClient) GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (*GetFileResponse, error) {
|
|
out := new(GetFileResponse)
|
|
err := c.cc.Invoke(ctx, "/ezshare.FileService/GetFile", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// FileServiceServer is the server API for FileService service.
|
|
// All implementations must embed UnimplementedFileServiceServer
|
|
// for forward compatibility
|
|
type FileServiceServer interface {
|
|
UploadFile(context.Context, *UploadFileRequest) (*UploadFileResponse, error)
|
|
GetFile(context.Context, *GetFileRequest) (*GetFileResponse, error)
|
|
mustEmbedUnimplementedFileServiceServer()
|
|
}
|
|
|
|
// UnimplementedFileServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedFileServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedFileServiceServer) UploadFile(context.Context, *UploadFileRequest) (*UploadFileResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UploadFile not implemented")
|
|
}
|
|
func (UnimplementedFileServiceServer) GetFile(context.Context, *GetFileRequest) (*GetFileResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetFile not implemented")
|
|
}
|
|
func (UnimplementedFileServiceServer) mustEmbedUnimplementedFileServiceServer() {}
|
|
|
|
// UnsafeFileServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to FileServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeFileServiceServer interface {
|
|
mustEmbedUnimplementedFileServiceServer()
|
|
}
|
|
|
|
func RegisterFileServiceServer(s grpc.ServiceRegistrar, srv FileServiceServer) {
|
|
s.RegisterService(&FileService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _FileService_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.(FileServiceServer).UploadFile(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.FileService/UploadFile",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(FileServiceServer).UploadFile(ctx, req.(*UploadFileRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _FileService_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.(FileServiceServer).GetFile(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.FileService/GetFile",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(FileServiceServer).GetFile(ctx, req.(*GetFileRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// FileService_ServiceDesc is the grpc.ServiceDesc for FileService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var FileService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "ezshare.FileService",
|
|
HandlerType: (*FileServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "UploadFile",
|
|
Handler: _FileService_UploadFile_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetFile",
|
|
Handler: _FileService_GetFile_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "protos/ezshare.proto",
|
|
}
|