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.
313 lines
9.2 KiB
313 lines
9.2 KiB
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.36.6
|
|
// protoc v6.30.2
|
|
// source: fileupload.proto
|
|
|
|
package fileupload
|
|
|
|
import (
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
reflect "reflect"
|
|
sync "sync"
|
|
unsafe "unsafe"
|
|
)
|
|
|
|
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 FileChunk struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
// 文件元信息,只在第一个数据块中包含
|
|
Info *FileInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"`
|
|
// 文件数据
|
|
Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
|
|
// 当前块的序号
|
|
ChunkIndex int32 `protobuf:"varint,3,opt,name=chunk_index,json=chunkIndex,proto3" json:"chunk_index,omitempty"`
|
|
// 总块数
|
|
TotalChunks int32 `protobuf:"varint,4,opt,name=total_chunks,json=totalChunks,proto3" json:"total_chunks,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *FileChunk) Reset() {
|
|
*x = FileChunk{}
|
|
mi := &file_fileupload_proto_msgTypes[0]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *FileChunk) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*FileChunk) ProtoMessage() {}
|
|
|
|
func (x *FileChunk) ProtoReflect() protoreflect.Message {
|
|
mi := &file_fileupload_proto_msgTypes[0]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use FileChunk.ProtoReflect.Descriptor instead.
|
|
func (*FileChunk) Descriptor() ([]byte, []int) {
|
|
return file_fileupload_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
func (x *FileChunk) GetInfo() *FileInfo {
|
|
if x != nil {
|
|
return x.Info
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *FileChunk) GetContent() []byte {
|
|
if x != nil {
|
|
return x.Content
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *FileChunk) GetChunkIndex() int32 {
|
|
if x != nil {
|
|
return x.ChunkIndex
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *FileChunk) GetTotalChunks() int32 {
|
|
if x != nil {
|
|
return x.TotalChunks
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// 文件元信息
|
|
type FileInfo struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
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"` // 文件大小(字节)
|
|
ContentType string `protobuf:"bytes,3,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` // 文件类型
|
|
UploadPath string `protobuf:"bytes,4,opt,name=upload_path,json=uploadPath,proto3" json:"upload_path,omitempty"` // 上传路径
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *FileInfo) Reset() {
|
|
*x = FileInfo{}
|
|
mi := &file_fileupload_proto_msgTypes[1]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *FileInfo) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*FileInfo) ProtoMessage() {}
|
|
|
|
func (x *FileInfo) ProtoReflect() protoreflect.Message {
|
|
mi := &file_fileupload_proto_msgTypes[1]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use FileInfo.ProtoReflect.Descriptor instead.
|
|
func (*FileInfo) Descriptor() ([]byte, []int) {
|
|
return file_fileupload_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
func (x *FileInfo) GetFileName() string {
|
|
if x != nil {
|
|
return x.FileName
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *FileInfo) GetFileSize() int64 {
|
|
if x != nil {
|
|
return x.FileSize
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *FileInfo) GetContentType() string {
|
|
if x != nil {
|
|
return x.ContentType
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *FileInfo) GetUploadPath() string {
|
|
if x != nil {
|
|
return x.UploadPath
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// 上传响应
|
|
type UploadResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // 是否成功
|
|
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // 响应消息
|
|
FilePath string `protobuf:"bytes,3,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"` // 服务器保存路径
|
|
ReceivedSize int64 `protobuf:"varint,4,opt,name=received_size,json=receivedSize,proto3" json:"received_size,omitempty"` // 接收的文件大小
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *UploadResponse) Reset() {
|
|
*x = UploadResponse{}
|
|
mi := &file_fileupload_proto_msgTypes[2]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *UploadResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*UploadResponse) ProtoMessage() {}
|
|
|
|
func (x *UploadResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_fileupload_proto_msgTypes[2]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use UploadResponse.ProtoReflect.Descriptor instead.
|
|
func (*UploadResponse) Descriptor() ([]byte, []int) {
|
|
return file_fileupload_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
func (x *UploadResponse) GetSuccess() bool {
|
|
if x != nil {
|
|
return x.Success
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (x *UploadResponse) GetMessage() string {
|
|
if x != nil {
|
|
return x.Message
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *UploadResponse) GetFilePath() string {
|
|
if x != nil {
|
|
return x.FilePath
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *UploadResponse) GetReceivedSize() int64 {
|
|
if x != nil {
|
|
return x.ReceivedSize
|
|
}
|
|
return 0
|
|
}
|
|
|
|
var File_fileupload_proto protoreflect.FileDescriptor
|
|
|
|
const file_fileupload_proto_rawDesc = "" +
|
|
"\n" +
|
|
"\x10fileupload.proto\x12\n" +
|
|
"fileupload\"\x93\x01\n" +
|
|
"\tFileChunk\x12(\n" +
|
|
"\x04info\x18\x01 \x01(\v2\x14.fileupload.FileInfoR\x04info\x12\x18\n" +
|
|
"\acontent\x18\x02 \x01(\fR\acontent\x12\x1f\n" +
|
|
"\vchunk_index\x18\x03 \x01(\x05R\n" +
|
|
"chunkIndex\x12!\n" +
|
|
"\ftotal_chunks\x18\x04 \x01(\x05R\vtotalChunks\"\x88\x01\n" +
|
|
"\bFileInfo\x12\x1b\n" +
|
|
"\tfile_name\x18\x01 \x01(\tR\bfileName\x12\x1b\n" +
|
|
"\tfile_size\x18\x02 \x01(\x03R\bfileSize\x12!\n" +
|
|
"\fcontent_type\x18\x03 \x01(\tR\vcontentType\x12\x1f\n" +
|
|
"\vupload_path\x18\x04 \x01(\tR\n" +
|
|
"uploadPath\"\x86\x01\n" +
|
|
"\x0eUploadResponse\x12\x18\n" +
|
|
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
|
|
"\amessage\x18\x02 \x01(\tR\amessage\x12\x1b\n" +
|
|
"\tfile_path\x18\x03 \x01(\tR\bfilePath\x12#\n" +
|
|
"\rreceived_size\x18\x04 \x01(\x03R\freceivedSize2V\n" +
|
|
"\x11FileUploadService\x12A\n" +
|
|
"\n" +
|
|
"UploadFile\x12\x15.fileupload.FileChunk\x1a\x1a.fileupload.UploadResponse(\x01B\x0eZ\f./fileuploadb\x06proto3"
|
|
|
|
var (
|
|
file_fileupload_proto_rawDescOnce sync.Once
|
|
file_fileupload_proto_rawDescData []byte
|
|
)
|
|
|
|
func file_fileupload_proto_rawDescGZIP() []byte {
|
|
file_fileupload_proto_rawDescOnce.Do(func() {
|
|
file_fileupload_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_fileupload_proto_rawDesc), len(file_fileupload_proto_rawDesc)))
|
|
})
|
|
return file_fileupload_proto_rawDescData
|
|
}
|
|
|
|
var file_fileupload_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
|
var file_fileupload_proto_goTypes = []any{
|
|
(*FileChunk)(nil), // 0: fileupload.FileChunk
|
|
(*FileInfo)(nil), // 1: fileupload.FileInfo
|
|
(*UploadResponse)(nil), // 2: fileupload.UploadResponse
|
|
}
|
|
var file_fileupload_proto_depIdxs = []int32{
|
|
1, // 0: fileupload.FileChunk.info:type_name -> fileupload.FileInfo
|
|
0, // 1: fileupload.FileUploadService.UploadFile:input_type -> fileupload.FileChunk
|
|
2, // 2: fileupload.FileUploadService.UploadFile:output_type -> fileupload.UploadResponse
|
|
2, // [2:3] is the sub-list for method output_type
|
|
1, // [1:2] is the sub-list for method input_type
|
|
1, // [1:1] is the sub-list for extension type_name
|
|
1, // [1:1] is the sub-list for extension extendee
|
|
0, // [0:1] is the sub-list for field type_name
|
|
}
|
|
|
|
func init() { file_fileupload_proto_init() }
|
|
func file_fileupload_proto_init() {
|
|
if File_fileupload_proto != nil {
|
|
return
|
|
}
|
|
type x struct{}
|
|
out := protoimpl.TypeBuilder{
|
|
File: protoimpl.DescBuilder{
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_fileupload_proto_rawDesc), len(file_fileupload_proto_rawDesc)),
|
|
NumEnums: 0,
|
|
NumMessages: 3,
|
|
NumExtensions: 0,
|
|
NumServices: 1,
|
|
},
|
|
GoTypes: file_fileupload_proto_goTypes,
|
|
DependencyIndexes: file_fileupload_proto_depIdxs,
|
|
MessageInfos: file_fileupload_proto_msgTypes,
|
|
}.Build()
|
|
File_fileupload_proto = out.File
|
|
file_fileupload_proto_goTypes = nil
|
|
file_fileupload_proto_depIdxs = nil
|
|
}
|
|
|