411 lines
12 KiB
Go
411 lines
12 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||
// versions:
|
||
// protoc-gen-go v1.36.6
|
||
// protoc v3.20.3
|
||
// source: rpc/file.proto
|
||
|
||
package file
|
||
|
||
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 UploadRequest struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` // 文件名(建议客户端传原始名,服务端会生成唯一名)
|
||
ContentType string `protobuf:"bytes,2,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` // 文件类型(如 image/jpeg)
|
||
Content []byte `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` // 文件二进制内容(base64 编码由客户端完成)
|
||
Folder string `protobuf:"bytes,4,opt,name=folder,proto3" json:"folder,omitempty"` // 可选,文件夹或分类路径,如 "avatars"、"wallpapers"
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *UploadRequest) Reset() {
|
||
*x = UploadRequest{}
|
||
mi := &file_rpc_file_proto_msgTypes[0]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *UploadRequest) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*UploadRequest) ProtoMessage() {}
|
||
|
||
func (x *UploadRequest) ProtoReflect() protoreflect.Message {
|
||
mi := &file_rpc_file_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 UploadRequest.ProtoReflect.Descriptor instead.
|
||
func (*UploadRequest) Descriptor() ([]byte, []int) {
|
||
return file_rpc_file_proto_rawDescGZIP(), []int{0}
|
||
}
|
||
|
||
func (x *UploadRequest) GetFilename() string {
|
||
if x != nil {
|
||
return x.Filename
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *UploadRequest) GetContentType() string {
|
||
if x != nil {
|
||
return x.ContentType
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *UploadRequest) GetContent() []byte {
|
||
if x != nil {
|
||
return x.Content
|
||
}
|
||
return nil
|
||
}
|
||
|
||
func (x *UploadRequest) GetFolder() string {
|
||
if x != nil {
|
||
return x.Folder
|
||
}
|
||
return ""
|
||
}
|
||
|
||
// 上传响应
|
||
type UploadResponse struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
FileId string `protobuf:"bytes,1,opt,name=file_id,json=fileId,proto3" json:"file_id,omitempty"` // 文件唯一 ID(或路径)
|
||
Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` // 可访问 URL(带 CDN 或签名)
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *UploadResponse) Reset() {
|
||
*x = UploadResponse{}
|
||
mi := &file_rpc_file_proto_msgTypes[1]
|
||
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_rpc_file_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 UploadResponse.ProtoReflect.Descriptor instead.
|
||
func (*UploadResponse) Descriptor() ([]byte, []int) {
|
||
return file_rpc_file_proto_rawDescGZIP(), []int{1}
|
||
}
|
||
|
||
func (x *UploadResponse) GetFileId() string {
|
||
if x != nil {
|
||
return x.FileId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
func (x *UploadResponse) GetUrl() string {
|
||
if x != nil {
|
||
return x.Url
|
||
}
|
||
return ""
|
||
}
|
||
|
||
// 获取访问链接请求
|
||
type GetFileUrlRequest struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
FileId string `protobuf:"bytes,1,opt,name=file_id,json=fileId,proto3" json:"file_id,omitempty"` // 文件唯一 ID 或路径
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *GetFileUrlRequest) Reset() {
|
||
*x = GetFileUrlRequest{}
|
||
mi := &file_rpc_file_proto_msgTypes[2]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *GetFileUrlRequest) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*GetFileUrlRequest) ProtoMessage() {}
|
||
|
||
func (x *GetFileUrlRequest) ProtoReflect() protoreflect.Message {
|
||
mi := &file_rpc_file_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 GetFileUrlRequest.ProtoReflect.Descriptor instead.
|
||
func (*GetFileUrlRequest) Descriptor() ([]byte, []int) {
|
||
return file_rpc_file_proto_rawDescGZIP(), []int{2}
|
||
}
|
||
|
||
func (x *GetFileUrlRequest) GetFileId() string {
|
||
if x != nil {
|
||
return x.FileId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
// 获取访问链接响应
|
||
type GetFileUrlResponse struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // 可访问链接
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *GetFileUrlResponse) Reset() {
|
||
*x = GetFileUrlResponse{}
|
||
mi := &file_rpc_file_proto_msgTypes[3]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *GetFileUrlResponse) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*GetFileUrlResponse) ProtoMessage() {}
|
||
|
||
func (x *GetFileUrlResponse) ProtoReflect() protoreflect.Message {
|
||
mi := &file_rpc_file_proto_msgTypes[3]
|
||
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 GetFileUrlResponse.ProtoReflect.Descriptor instead.
|
||
func (*GetFileUrlResponse) Descriptor() ([]byte, []int) {
|
||
return file_rpc_file_proto_rawDescGZIP(), []int{3}
|
||
}
|
||
|
||
func (x *GetFileUrlResponse) GetUrl() string {
|
||
if x != nil {
|
||
return x.Url
|
||
}
|
||
return ""
|
||
}
|
||
|
||
// 删除文件请求
|
||
type DeleteRequest struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
FileId string `protobuf:"bytes,1,opt,name=file_id,json=fileId,proto3" json:"file_id,omitempty"` // 要删除的文件 ID
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *DeleteRequest) Reset() {
|
||
*x = DeleteRequest{}
|
||
mi := &file_rpc_file_proto_msgTypes[4]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *DeleteRequest) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*DeleteRequest) ProtoMessage() {}
|
||
|
||
func (x *DeleteRequest) ProtoReflect() protoreflect.Message {
|
||
mi := &file_rpc_file_proto_msgTypes[4]
|
||
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 DeleteRequest.ProtoReflect.Descriptor instead.
|
||
func (*DeleteRequest) Descriptor() ([]byte, []int) {
|
||
return file_rpc_file_proto_rawDescGZIP(), []int{4}
|
||
}
|
||
|
||
func (x *DeleteRequest) GetFileId() string {
|
||
if x != nil {
|
||
return x.FileId
|
||
}
|
||
return ""
|
||
}
|
||
|
||
// 删除文件响应
|
||
type DeleteResponse struct {
|
||
state protoimpl.MessageState `protogen:"open.v1"`
|
||
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // 是否删除成功
|
||
unknownFields protoimpl.UnknownFields
|
||
sizeCache protoimpl.SizeCache
|
||
}
|
||
|
||
func (x *DeleteResponse) Reset() {
|
||
*x = DeleteResponse{}
|
||
mi := &file_rpc_file_proto_msgTypes[5]
|
||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||
ms.StoreMessageInfo(mi)
|
||
}
|
||
|
||
func (x *DeleteResponse) String() string {
|
||
return protoimpl.X.MessageStringOf(x)
|
||
}
|
||
|
||
func (*DeleteResponse) ProtoMessage() {}
|
||
|
||
func (x *DeleteResponse) ProtoReflect() protoreflect.Message {
|
||
mi := &file_rpc_file_proto_msgTypes[5]
|
||
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 DeleteResponse.ProtoReflect.Descriptor instead.
|
||
func (*DeleteResponse) Descriptor() ([]byte, []int) {
|
||
return file_rpc_file_proto_rawDescGZIP(), []int{5}
|
||
}
|
||
|
||
func (x *DeleteResponse) GetSuccess() bool {
|
||
if x != nil {
|
||
return x.Success
|
||
}
|
||
return false
|
||
}
|
||
|
||
var File_rpc_file_proto protoreflect.FileDescriptor
|
||
|
||
const file_rpc_file_proto_rawDesc = "" +
|
||
"\n" +
|
||
"\x0erpc/file.proto\x12\x04file\"\x80\x01\n" +
|
||
"\rUploadRequest\x12\x1a\n" +
|
||
"\bfilename\x18\x01 \x01(\tR\bfilename\x12!\n" +
|
||
"\fcontent_type\x18\x02 \x01(\tR\vcontentType\x12\x18\n" +
|
||
"\acontent\x18\x03 \x01(\fR\acontent\x12\x16\n" +
|
||
"\x06folder\x18\x04 \x01(\tR\x06folder\";\n" +
|
||
"\x0eUploadResponse\x12\x17\n" +
|
||
"\afile_id\x18\x01 \x01(\tR\x06fileId\x12\x10\n" +
|
||
"\x03url\x18\x02 \x01(\tR\x03url\",\n" +
|
||
"\x11GetFileUrlRequest\x12\x17\n" +
|
||
"\afile_id\x18\x01 \x01(\tR\x06fileId\"&\n" +
|
||
"\x12GetFileUrlResponse\x12\x10\n" +
|
||
"\x03url\x18\x01 \x01(\tR\x03url\"(\n" +
|
||
"\rDeleteRequest\x12\x17\n" +
|
||
"\afile_id\x18\x01 \x01(\tR\x06fileId\"*\n" +
|
||
"\x0eDeleteResponse\x12\x18\n" +
|
||
"\asuccess\x18\x01 \x01(\bR\asuccess2\xb1\x01\n" +
|
||
"\x04File\x123\n" +
|
||
"\x06Upload\x12\x13.file.UploadRequest\x1a\x14.file.UploadResponse\x12?\n" +
|
||
"\n" +
|
||
"GetFileUrl\x12\x17.file.GetFileUrlRequest\x1a\x18.file.GetFileUrlResponse\x123\n" +
|
||
"\x06Delete\x12\x13.file.DeleteRequest\x1a\x14.file.DeleteResponseB\bZ\x06./fileb\x06proto3"
|
||
|
||
var (
|
||
file_rpc_file_proto_rawDescOnce sync.Once
|
||
file_rpc_file_proto_rawDescData []byte
|
||
)
|
||
|
||
func file_rpc_file_proto_rawDescGZIP() []byte {
|
||
file_rpc_file_proto_rawDescOnce.Do(func() {
|
||
file_rpc_file_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_rpc_file_proto_rawDesc), len(file_rpc_file_proto_rawDesc)))
|
||
})
|
||
return file_rpc_file_proto_rawDescData
|
||
}
|
||
|
||
var file_rpc_file_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||
var file_rpc_file_proto_goTypes = []any{
|
||
(*UploadRequest)(nil), // 0: file.UploadRequest
|
||
(*UploadResponse)(nil), // 1: file.UploadResponse
|
||
(*GetFileUrlRequest)(nil), // 2: file.GetFileUrlRequest
|
||
(*GetFileUrlResponse)(nil), // 3: file.GetFileUrlResponse
|
||
(*DeleteRequest)(nil), // 4: file.DeleteRequest
|
||
(*DeleteResponse)(nil), // 5: file.DeleteResponse
|
||
}
|
||
var file_rpc_file_proto_depIdxs = []int32{
|
||
0, // 0: file.File.Upload:input_type -> file.UploadRequest
|
||
2, // 1: file.File.GetFileUrl:input_type -> file.GetFileUrlRequest
|
||
4, // 2: file.File.Delete:input_type -> file.DeleteRequest
|
||
1, // 3: file.File.Upload:output_type -> file.UploadResponse
|
||
3, // 4: file.File.GetFileUrl:output_type -> file.GetFileUrlResponse
|
||
5, // 5: file.File.Delete:output_type -> file.DeleteResponse
|
||
3, // [3:6] is the sub-list for method output_type
|
||
0, // [0:3] 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_rpc_file_proto_init() }
|
||
func file_rpc_file_proto_init() {
|
||
if File_rpc_file_proto != nil {
|
||
return
|
||
}
|
||
type x struct{}
|
||
out := protoimpl.TypeBuilder{
|
||
File: protoimpl.DescBuilder{
|
||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_rpc_file_proto_rawDesc), len(file_rpc_file_proto_rawDesc)),
|
||
NumEnums: 0,
|
||
NumMessages: 6,
|
||
NumExtensions: 0,
|
||
NumServices: 1,
|
||
},
|
||
GoTypes: file_rpc_file_proto_goTypes,
|
||
DependencyIndexes: file_rpc_file_proto_depIdxs,
|
||
MessageInfos: file_rpc_file_proto_msgTypes,
|
||
}.Build()
|
||
File_rpc_file_proto = out.File
|
||
file_rpc_file_proto_goTypes = nil
|
||
file_rpc_file_proto_depIdxs = nil
|
||
}
|