You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
121 lines
4.9 KiB
121 lines
4.9 KiB
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc v6.30.2
|
|
// source: fileupload.proto
|
|
|
|
package fileupload
|
|
|
|
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.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
FileUploadService_UploadFile_FullMethodName = "/fileupload.FileUploadService/UploadFile"
|
|
)
|
|
|
|
// FileUploadServiceClient is the client API for FileUploadService 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 FileUploadServiceClient interface {
|
|
// 上传文件的 RPC 方法,使用流式传输
|
|
UploadFile(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[FileChunk, UploadResponse], error)
|
|
}
|
|
|
|
type fileUploadServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewFileUploadServiceClient(cc grpc.ClientConnInterface) FileUploadServiceClient {
|
|
return &fileUploadServiceClient{cc}
|
|
}
|
|
|
|
func (c *fileUploadServiceClient) UploadFile(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[FileChunk, UploadResponse], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &FileUploadService_ServiceDesc.Streams[0], FileUploadService_UploadFile_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[FileChunk, UploadResponse]{ClientStream: stream}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type FileUploadService_UploadFileClient = grpc.ClientStreamingClient[FileChunk, UploadResponse]
|
|
|
|
// FileUploadServiceServer is the server API for FileUploadService service.
|
|
// All implementations must embed UnimplementedFileUploadServiceServer
|
|
// for forward compatibility.
|
|
//
|
|
// 文件上传服务定义
|
|
type FileUploadServiceServer interface {
|
|
// 上传文件的 RPC 方法,使用流式传输
|
|
UploadFile(grpc.ClientStreamingServer[FileChunk, UploadResponse]) error
|
|
mustEmbedUnimplementedFileUploadServiceServer()
|
|
}
|
|
|
|
// UnimplementedFileUploadServiceServer must be embedded to have
|
|
// forward compatible implementations.
|
|
//
|
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
// pointer dereference when methods are called.
|
|
type UnimplementedFileUploadServiceServer struct{}
|
|
|
|
func (UnimplementedFileUploadServiceServer) UploadFile(grpc.ClientStreamingServer[FileChunk, UploadResponse]) error {
|
|
return status.Errorf(codes.Unimplemented, "method UploadFile not implemented")
|
|
}
|
|
func (UnimplementedFileUploadServiceServer) mustEmbedUnimplementedFileUploadServiceServer() {}
|
|
func (UnimplementedFileUploadServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeFileUploadServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to FileUploadServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeFileUploadServiceServer interface {
|
|
mustEmbedUnimplementedFileUploadServiceServer()
|
|
}
|
|
|
|
func RegisterFileUploadServiceServer(s grpc.ServiceRegistrar, srv FileUploadServiceServer) {
|
|
// If the following call pancis, it indicates UnimplementedFileUploadServiceServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&FileUploadService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _FileUploadService_UploadFile_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(FileUploadServiceServer).UploadFile(&grpc.GenericServerStream[FileChunk, UploadResponse]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type FileUploadService_UploadFileServer = grpc.ClientStreamingServer[FileChunk, UploadResponse]
|
|
|
|
// FileUploadService_ServiceDesc is the grpc.ServiceDesc for FileUploadService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var FileUploadService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "fileupload.FileUploadService",
|
|
HandlerType: (*FileUploadServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "UploadFile",
|
|
Handler: _FileUploadService_UploadFile_Handler,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "fileupload.proto",
|
|
}
|
|
|