478 lines
14 KiB
Go
478 lines
14 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.26.0
|
|
// protoc v3.15.8
|
|
// source: proto/transport.proto
|
|
|
|
package proto
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
reflect "reflect"
|
|
sync "sync"
|
|
)
|
|
|
|
const (
|
|
// Verify that this generated code is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
)
|
|
|
|
type ListRequestType struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
}
|
|
|
|
func (x *ListRequestType) Reset() {
|
|
*x = ListRequestType{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_proto_transport_proto_msgTypes[0]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *ListRequestType) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ListRequestType) ProtoMessage() {}
|
|
|
|
func (x *ListRequestType) ProtoReflect() protoreflect.Message {
|
|
mi := &file_proto_transport_proto_msgTypes[0]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ListRequestType.ProtoReflect.Descriptor instead.
|
|
func (*ListRequestType) Descriptor() ([]byte, []int) {
|
|
return file_proto_transport_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
type ListResponseType struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
|
|
FileSize int64 `protobuf:"varint,2,opt,name=file_size,json=fileSize,proto3" json:"file_size,omitempty"`
|
|
FileMode uint32 `protobuf:"varint,3,opt,name=file_mode,json=fileMode,proto3" json:"file_mode,omitempty"`
|
|
}
|
|
|
|
func (x *ListResponseType) Reset() {
|
|
*x = ListResponseType{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_proto_transport_proto_msgTypes[1]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *ListResponseType) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ListResponseType) ProtoMessage() {}
|
|
|
|
func (x *ListResponseType) ProtoReflect() protoreflect.Message {
|
|
mi := &file_proto_transport_proto_msgTypes[1]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ListResponseType.ProtoReflect.Descriptor instead.
|
|
func (*ListResponseType) Descriptor() ([]byte, []int) {
|
|
return file_proto_transport_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
func (x *ListResponseType) GetFileName() string {
|
|
if x != nil {
|
|
return x.FileName
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *ListResponseType) GetFileSize() int64 {
|
|
if x != nil {
|
|
return x.FileSize
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *ListResponseType) GetFileMode() uint32 {
|
|
if x != nil {
|
|
return x.FileMode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type FileRequest struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
|
|
FileRange int64 `protobuf:"varint,2,opt,name=file_range,json=fileRange,proto3" json:"file_range,omitempty"`
|
|
}
|
|
|
|
func (x *FileRequest) Reset() {
|
|
*x = FileRequest{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_proto_transport_proto_msgTypes[2]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *FileRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*FileRequest) ProtoMessage() {}
|
|
|
|
func (x *FileRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_proto_transport_proto_msgTypes[2]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use FileRequest.ProtoReflect.Descriptor instead.
|
|
func (*FileRequest) Descriptor() ([]byte, []int) {
|
|
return file_proto_transport_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
func (x *FileRequest) GetFileName() string {
|
|
if x != nil {
|
|
return x.FileName
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *FileRequest) GetFileRange() int64 {
|
|
if x != nil {
|
|
return x.FileRange
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type FileResponse struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
Block []byte `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"`
|
|
FileSize int64 `protobuf:"varint,2,opt,name=file_size,json=fileSize,proto3" json:"file_size,omitempty"`
|
|
}
|
|
|
|
func (x *FileResponse) Reset() {
|
|
*x = FileResponse{}
|
|
if protoimpl.UnsafeEnabled {
|
|
mi := &file_proto_transport_proto_msgTypes[3]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
}
|
|
|
|
func (x *FileResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*FileResponse) ProtoMessage() {}
|
|
|
|
func (x *FileResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_proto_transport_proto_msgTypes[3]
|
|
if protoimpl.UnsafeEnabled && x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use FileResponse.ProtoReflect.Descriptor instead.
|
|
func (*FileResponse) Descriptor() ([]byte, []int) {
|
|
return file_proto_transport_proto_rawDescGZIP(), []int{3}
|
|
}
|
|
|
|
func (x *FileResponse) GetBlock() []byte {
|
|
if x != nil {
|
|
return x.Block
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *FileResponse) GetFileSize() int64 {
|
|
if x != nil {
|
|
return x.FileSize
|
|
}
|
|
return 0
|
|
}
|
|
|
|
var File_proto_transport_proto protoreflect.FileDescriptor
|
|
|
|
var file_proto_transport_proto_rawDesc = []byte{
|
|
0x0a, 0x15, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72,
|
|
0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x11,
|
|
0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x79, 0x70,
|
|
0x65, 0x22, 0x69, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
|
0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61,
|
|
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61,
|
|
0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18,
|
|
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12,
|
|
0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01,
|
|
0x28, 0x0d, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x22, 0x49, 0x0a, 0x0b,
|
|
0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x66,
|
|
0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
|
|
0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x6c, 0x65,
|
|
0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x69,
|
|
0x6c, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x41, 0x0a, 0x0c, 0x66, 0x69, 0x6c, 0x65, 0x52,
|
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
|
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1b, 0x0a,
|
|
0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
|
|
0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x32, 0x46, 0x0a, 0x0b, 0x66, 0x69,
|
|
0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x44, 0x6f, 0x77,
|
|
0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x66, 0x69,
|
|
0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
|
0x6f, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
|
0x30, 0x01, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70,
|
|
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
}
|
|
|
|
var (
|
|
file_proto_transport_proto_rawDescOnce sync.Once
|
|
file_proto_transport_proto_rawDescData = file_proto_transport_proto_rawDesc
|
|
)
|
|
|
|
func file_proto_transport_proto_rawDescGZIP() []byte {
|
|
file_proto_transport_proto_rawDescOnce.Do(func() {
|
|
file_proto_transport_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_transport_proto_rawDescData)
|
|
})
|
|
return file_proto_transport_proto_rawDescData
|
|
}
|
|
|
|
var file_proto_transport_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
|
var file_proto_transport_proto_goTypes = []interface{}{
|
|
(*ListRequestType)(nil), // 0: proto.ListRequestType
|
|
(*ListResponseType)(nil), // 1: proto.ListResponseType
|
|
(*FileRequest)(nil), // 2: proto.fileRequest
|
|
(*FileResponse)(nil), // 3: proto.fileResponse
|
|
}
|
|
var file_proto_transport_proto_depIdxs = []int32{
|
|
2, // 0: proto.fileService.Download:input_type -> proto.fileRequest
|
|
3, // 1: proto.fileService.Download:output_type -> proto.fileResponse
|
|
1, // [1:2] is the sub-list for method output_type
|
|
0, // [0:1] is the sub-list for method input_type
|
|
0, // [0:0] is the sub-list for extension type_name
|
|
0, // [0:0] is the sub-list for extension extendee
|
|
0, // [0:0] is the sub-list for field type_name
|
|
}
|
|
|
|
func init() { file_proto_transport_proto_init() }
|
|
func file_proto_transport_proto_init() {
|
|
if File_proto_transport_proto != nil {
|
|
return
|
|
}
|
|
if !protoimpl.UnsafeEnabled {
|
|
file_proto_transport_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*ListRequestType); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
file_proto_transport_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*ListResponseType); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
file_proto_transport_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*FileRequest); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
file_proto_transport_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
|
switch v := v.(*FileResponse); i {
|
|
case 0:
|
|
return &v.state
|
|
case 1:
|
|
return &v.sizeCache
|
|
case 2:
|
|
return &v.unknownFields
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
type x struct{}
|
|
out := protoimpl.TypeBuilder{
|
|
File: protoimpl.DescBuilder{
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
RawDescriptor: file_proto_transport_proto_rawDesc,
|
|
NumEnums: 0,
|
|
NumMessages: 4,
|
|
NumExtensions: 0,
|
|
NumServices: 1,
|
|
},
|
|
GoTypes: file_proto_transport_proto_goTypes,
|
|
DependencyIndexes: file_proto_transport_proto_depIdxs,
|
|
MessageInfos: file_proto_transport_proto_msgTypes,
|
|
}.Build()
|
|
File_proto_transport_proto = out.File
|
|
file_proto_transport_proto_rawDesc = nil
|
|
file_proto_transport_proto_goTypes = nil
|
|
file_proto_transport_proto_depIdxs = nil
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConnInterface
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion6
|
|
|
|
// FileServiceClient is the client API for FileService service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type FileServiceClient interface {
|
|
Download(ctx context.Context, in *FileRequest, opts ...grpc.CallOption) (FileService_DownloadClient, error)
|
|
}
|
|
|
|
type fileServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewFileServiceClient(cc grpc.ClientConnInterface) FileServiceClient {
|
|
return &fileServiceClient{cc}
|
|
}
|
|
|
|
func (c *fileServiceClient) Download(ctx context.Context, in *FileRequest, opts ...grpc.CallOption) (FileService_DownloadClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_FileService_serviceDesc.Streams[0], "/proto.fileService/Download", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &fileServiceDownloadClient{stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
type FileService_DownloadClient interface {
|
|
Recv() (*FileResponse, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type fileServiceDownloadClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *fileServiceDownloadClient) Recv() (*FileResponse, error) {
|
|
m := new(FileResponse)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// FileServiceServer is the server API for FileService service.
|
|
type FileServiceServer interface {
|
|
Download(*FileRequest, FileService_DownloadServer) error
|
|
}
|
|
|
|
// UnimplementedFileServiceServer can be embedded to have forward compatible implementations.
|
|
type UnimplementedFileServiceServer struct {
|
|
}
|
|
|
|
func (*UnimplementedFileServiceServer) Download(*FileRequest, FileService_DownloadServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method Download not implemented")
|
|
}
|
|
|
|
func RegisterFileServiceServer(s *grpc.Server, srv FileServiceServer) {
|
|
s.RegisterService(&_FileService_serviceDesc, srv)
|
|
}
|
|
|
|
func _FileService_Download_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(FileRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(FileServiceServer).Download(m, &fileServiceDownloadServer{stream})
|
|
}
|
|
|
|
type FileService_DownloadServer interface {
|
|
Send(*FileResponse) error
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type fileServiceDownloadServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *fileServiceDownloadServer) Send(m *FileResponse) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
var _FileService_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "proto.fileService",
|
|
HandlerType: (*FileServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Download",
|
|
Handler: _FileService_Download_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "proto/transport.proto",
|
|
}
|