file

package
v0.0.0-...-469a15f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package file is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "jmash.file.File",
	HandlerType: (*FileServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "findEnumList",
			Handler:    _File_FindEnumList_Handler,
		},
		{
			MethodName: "findEnumMap",
			Handler:    _File_FindEnumMap_Handler,
		},
		{
			MethodName: "findJmashFilePage",
			Handler:    _File_FindJmashFilePage_Handler,
		},
		{
			MethodName: "findJmashFileList",
			Handler:    _File_FindJmashFileList_Handler,
		},
		{
			MethodName: "findJmashFileById",
			Handler:    _File_FindJmashFileById_Handler,
		},
		{
			MethodName: "deleteJmashFile",
			Handler:    _File_DeleteJmashFile_Handler,
		},
		{
			MethodName: "batchDeleteJmashFile",
			Handler:    _File_BatchDeleteJmashFile_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "jmash/file/file_rpc.proto",
}

File_ServiceDesc is the grpc.ServiceDesc for File service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_jmash_file_file_rpc_proto protoreflect.FileDescriptor
View Source
var File_jmash_file_protobuf_file_message_proto protoreflect.FileDescriptor

Functions

func RegisterFileHandler

func RegisterFileHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterFileHandler registers the http handlers for service File to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterFileHandlerClient

func RegisterFileHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FileClient) error

RegisterFileHandlerClient registers the http handlers for service File to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "FileClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "FileClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "FileClient" to call the correct interceptors.

func RegisterFileHandlerFromEndpoint

func RegisterFileHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterFileHandlerFromEndpoint is same as RegisterFileHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterFileHandlerServer

func RegisterFileHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FileServer) error

RegisterFileHandlerServer registers the http handlers for service File to "mux". UnaryRPC :call FileServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterFileHandlerFromEndpoint instead.

func RegisterFileServer

func RegisterFileServer(s grpc.ServiceRegistrar, srv FileServer)

Types

type FileClient

type FileClient interface {
	// 枚举值列表
	FindEnumList(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*basic.EnumValueList, error)
	// 枚举值Map
	FindEnumMap(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*basic.CustomEnumValueMap, error)
	// 查询翻页信息
	FindJmashFilePage(ctx context.Context, in *JmashFileReq, opts ...grpc.CallOption) (*JmashFilePage, error)
	// 查询列表信息
	FindJmashFileList(ctx context.Context, in *JmashFileReq, opts ...grpc.CallOption) (*JmashFileList, error)
	// 查询
	FindJmashFileById(ctx context.Context, in *JmashFileKey, opts ...grpc.CallOption) (*JmashFileModel, error)
	// 删除
	DeleteJmashFile(ctx context.Context, in *JmashFileKey, opts ...grpc.CallOption) (*JmashFileModel, error)
	// 批量删除
	BatchDeleteJmashFile(ctx context.Context, in *JmashFileKeyList, opts ...grpc.CallOption) (*wrapperspb.Int32Value, error)
}

FileClient is the client API for File 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.

func NewFileClient

func NewFileClient(cc grpc.ClientConnInterface) FileClient

type FileServer

type FileServer interface {
	// 枚举值列表
	FindEnumList(context.Context, *wrapperspb.StringValue) (*basic.EnumValueList, error)
	// 枚举值Map
	FindEnumMap(context.Context, *wrapperspb.StringValue) (*basic.CustomEnumValueMap, error)
	// 查询翻页信息
	FindJmashFilePage(context.Context, *JmashFileReq) (*JmashFilePage, error)
	// 查询列表信息
	FindJmashFileList(context.Context, *JmashFileReq) (*JmashFileList, error)
	// 查询
	FindJmashFileById(context.Context, *JmashFileKey) (*JmashFileModel, error)
	// 删除
	DeleteJmashFile(context.Context, *JmashFileKey) (*JmashFileModel, error)
	// 批量删除
	BatchDeleteJmashFile(context.Context, *JmashFileKeyList) (*wrapperspb.Int32Value, error)
	// contains filtered or unexported methods
}

FileServer is the server API for File service. All implementations must embed UnimplementedFileServer for forward compatibility

type JmashFileKey

type JmashFileKey struct {

	// 租户.
	Tenant string `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"`
	FileId string `protobuf:"bytes,2,opt,name=file_id,json=fileId,proto3" json:"file_id,omitempty"`
	// contains filtered or unexported fields
}

List

func (*JmashFileKey) Descriptor deprecated

func (*JmashFileKey) Descriptor() ([]byte, []int)

Deprecated: Use JmashFileKey.ProtoReflect.Descriptor instead.

func (*JmashFileKey) GetFileId

func (x *JmashFileKey) GetFileId() string

func (*JmashFileKey) GetTenant

func (x *JmashFileKey) GetTenant() string

func (*JmashFileKey) ProtoMessage

func (*JmashFileKey) ProtoMessage()

func (*JmashFileKey) ProtoReflect

func (x *JmashFileKey) ProtoReflect() protoreflect.Message

func (*JmashFileKey) Reset

func (x *JmashFileKey) Reset()

func (*JmashFileKey) String

func (x *JmashFileKey) String() string

type JmashFileKeyList

type JmashFileKeyList struct {

	// 租户.
	Tenant string   `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"`
	FileId []string `protobuf:"bytes,2,rep,name=file_id,json=fileId,proto3" json:"file_id,omitempty"`
	// contains filtered or unexported fields
}

List

func (*JmashFileKeyList) Descriptor deprecated

func (*JmashFileKeyList) Descriptor() ([]byte, []int)

Deprecated: Use JmashFileKeyList.ProtoReflect.Descriptor instead.

func (*JmashFileKeyList) GetFileId

func (x *JmashFileKeyList) GetFileId() []string

func (*JmashFileKeyList) GetTenant

func (x *JmashFileKeyList) GetTenant() string

func (*JmashFileKeyList) ProtoMessage

func (*JmashFileKeyList) ProtoMessage()

func (*JmashFileKeyList) ProtoReflect

func (x *JmashFileKeyList) ProtoReflect() protoreflect.Message

func (*JmashFileKeyList) Reset

func (x *JmashFileKeyList) Reset()

func (*JmashFileKeyList) String

func (x *JmashFileKeyList) String() string

type JmashFileList

type JmashFileList struct {

	// 当前页内容
	Results []*JmashFileModel `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
	// contains filtered or unexported fields
}

列表

func (*JmashFileList) Descriptor deprecated

func (*JmashFileList) Descriptor() ([]byte, []int)

Deprecated: Use JmashFileList.ProtoReflect.Descriptor instead.

func (*JmashFileList) GetResults

func (x *JmashFileList) GetResults() []*JmashFileModel

func (*JmashFileList) ProtoMessage

func (*JmashFileList) ProtoMessage()

func (*JmashFileList) ProtoReflect

func (x *JmashFileList) ProtoReflect() protoreflect.Message

func (*JmashFileList) Reset

func (x *JmashFileList) Reset()

func (*JmashFileList) String

func (x *JmashFileList) String() string

type JmashFileModel

type JmashFileModel struct {

	// 文件ID
	FileId string `protobuf:"bytes,1,opt,name=file_id,json=fileId,proto3" json:"file_id,omitempty"`
	// 文件存储路径
	FileSrc string `protobuf:"bytes,2,opt,name=file_src,json=fileSrc,proto3" json:"file_src,omitempty"`
	// 文件内容类型
	ContentType string `protobuf:"bytes,3,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
	// 文件后缀
	FileExt string `protobuf:"bytes,4,opt,name=file_ext,json=fileExt,proto3" json:"file_ext,omitempty"`
	// 文件大小
	FileSize int64 `protobuf:"varint,5,opt,name=file_size,json=fileSize,proto3" json:"file_size,omitempty"`
	// 文件Hash SM3值
	HashSm3 []byte `protobuf:"bytes,6,opt,name=hash_sm3,json=hashSm3,proto3" json:"hash_sm3,omitempty"`
	// 文件Hash SHA256值
	HashSha256 []byte `protobuf:"bytes,7,opt,name=hash_sha256,json=hashSha256,proto3" json:"hash_sha256,omitempty"`
	// 图片/视频宽度
	FileWidth int32 `protobuf:"varint,8,opt,name=file_width,json=fileWidth,proto3" json:"file_width,omitempty"`
	// 图片/视频高度
	FileHeight int32 `protobuf:"varint,9,opt,name=file_height,json=fileHeight,proto3" json:"file_height,omitempty"`
	// 音频/视频时长
	FileTime int32 `protobuf:"varint,10,opt,name=file_time,json=fileTime,proto3" json:"file_time,omitempty"`
	// 图片/视频/音频拍摄位置
	FileLocation string `protobuf:"bytes,11,opt,name=file_location,json=fileLocation,proto3" json:"file_location,omitempty"`
	// 经度
	GeoLongitude string `protobuf:"bytes,12,opt,name=geo_longitude,json=geoLongitude,proto3" json:"geo_longitude,omitempty"`
	// 纬度
	GeoLatitude string `protobuf:"bytes,13,opt,name=geo_latitude,json=geoLatitude,proto3" json:"geo_latitude,omitempty"`
	// 精度
	GeoAccuracy int32 `protobuf:"varint,14,opt,name=geo_accuracy,json=geoAccuracy,proto3" json:"geo_accuracy,omitempty"`
	// 海拔高度
	GeoAltitude int64 `protobuf:"varint,15,opt,name=geo_altitude,json=geoAltitude,proto3" json:"geo_altitude,omitempty"`
	// 海拔高度精度
	GeoAltitudeAccracy int32 `protobuf:"varint,16,opt,name=geo_altitude_accracy,json=geoAltitudeAccracy,proto3" json:"geo_altitude_accracy,omitempty"`
	// 创建时间
	CreateDate *timestamppb.Timestamp `protobuf:"bytes,17,opt,name=create_date,json=createDate,proto3" json:"create_date,omitempty"`
	// contains filtered or unexported fields
}

实体

func (*JmashFileModel) Descriptor deprecated

func (*JmashFileModel) Descriptor() ([]byte, []int)

Deprecated: Use JmashFileModel.ProtoReflect.Descriptor instead.

func (*JmashFileModel) GetContentType

func (x *JmashFileModel) GetContentType() string

func (*JmashFileModel) GetCreateDate

func (x *JmashFileModel) GetCreateDate() *timestamppb.Timestamp

func (*JmashFileModel) GetFileExt

func (x *JmashFileModel) GetFileExt() string

func (*JmashFileModel) GetFileHeight

func (x *JmashFileModel) GetFileHeight() int32

func (*JmashFileModel) GetFileId

func (x *JmashFileModel) GetFileId() string

func (*JmashFileModel) GetFileLocation

func (x *JmashFileModel) GetFileLocation() string

func (*JmashFileModel) GetFileSize

func (x *JmashFileModel) GetFileSize() int64

func (*JmashFileModel) GetFileSrc

func (x *JmashFileModel) GetFileSrc() string

func (*JmashFileModel) GetFileTime

func (x *JmashFileModel) GetFileTime() int32

func (*JmashFileModel) GetFileWidth

func (x *JmashFileModel) GetFileWidth() int32

func (*JmashFileModel) GetGeoAccuracy

func (x *JmashFileModel) GetGeoAccuracy() int32

func (*JmashFileModel) GetGeoAltitude

func (x *JmashFileModel) GetGeoAltitude() int64

func (*JmashFileModel) GetGeoAltitudeAccracy

func (x *JmashFileModel) GetGeoAltitudeAccracy() int32

func (*JmashFileModel) GetGeoLatitude

func (x *JmashFileModel) GetGeoLatitude() string

func (*JmashFileModel) GetGeoLongitude

func (x *JmashFileModel) GetGeoLongitude() string

func (*JmashFileModel) GetHashSha256

func (x *JmashFileModel) GetHashSha256() []byte

func (*JmashFileModel) GetHashSm3

func (x *JmashFileModel) GetHashSm3() []byte

func (*JmashFileModel) ProtoMessage

func (*JmashFileModel) ProtoMessage()

func (*JmashFileModel) ProtoReflect

func (x *JmashFileModel) ProtoReflect() protoreflect.Message

func (*JmashFileModel) Reset

func (x *JmashFileModel) Reset()

func (*JmashFileModel) String

func (x *JmashFileModel) String() string

type JmashFileModelTotal

type JmashFileModelTotal struct {

	// 总记录数
	TotalSize int32 `protobuf:"varint,1,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"`
	// contains filtered or unexported fields
}

合计

func (*JmashFileModelTotal) Descriptor deprecated

func (*JmashFileModelTotal) Descriptor() ([]byte, []int)

Deprecated: Use JmashFileModelTotal.ProtoReflect.Descriptor instead.

func (*JmashFileModelTotal) GetTotalSize

func (x *JmashFileModelTotal) GetTotalSize() int32

func (*JmashFileModelTotal) ProtoMessage

func (*JmashFileModelTotal) ProtoMessage()

func (*JmashFileModelTotal) ProtoReflect

func (x *JmashFileModelTotal) ProtoReflect() protoreflect.Message

func (*JmashFileModelTotal) Reset

func (x *JmashFileModelTotal) Reset()

func (*JmashFileModelTotal) String

func (x *JmashFileModelTotal) String() string

type JmashFilePage

type JmashFilePage struct {

	// 当前页内容
	Results []*JmashFileModel `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
	// 当前页码
	CurPage int32 `protobuf:"varint,2,opt,name=cur_page,json=curPage,proto3" json:"cur_page,omitempty"`
	// 页尺寸
	PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// 总记录数
	TotalSize int32 `protobuf:"varint,4,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"`
	// 本页小计
	SubTotalDto *JmashFileModelTotal `protobuf:"bytes,5,opt,name=sub_total_dto,json=subTotalDto,proto3" json:"sub_total_dto,omitempty"`
	// 合计
	TotalDto *JmashFileModelTotal `protobuf:"bytes,6,opt,name=total_dto,json=totalDto,proto3" json:"total_dto,omitempty"`
	// contains filtered or unexported fields
}

分页

func (*JmashFilePage) Descriptor deprecated

func (*JmashFilePage) Descriptor() ([]byte, []int)

Deprecated: Use JmashFilePage.ProtoReflect.Descriptor instead.

func (*JmashFilePage) GetCurPage

func (x *JmashFilePage) GetCurPage() int32

func (*JmashFilePage) GetPageSize

func (x *JmashFilePage) GetPageSize() int32

func (*JmashFilePage) GetResults

func (x *JmashFilePage) GetResults() []*JmashFileModel

func (*JmashFilePage) GetSubTotalDto

func (x *JmashFilePage) GetSubTotalDto() *JmashFileModelTotal

func (*JmashFilePage) GetTotalDto

func (x *JmashFilePage) GetTotalDto() *JmashFileModelTotal

func (*JmashFilePage) GetTotalSize

func (x *JmashFilePage) GetTotalSize() int32

func (*JmashFilePage) ProtoMessage

func (*JmashFilePage) ProtoMessage()

func (*JmashFilePage) ProtoReflect

func (x *JmashFilePage) ProtoReflect() protoreflect.Message

func (*JmashFilePage) Reset

func (x *JmashFilePage) Reset()

func (*JmashFilePage) String

func (x *JmashFilePage) String() string

type JmashFileReq

type JmashFileReq struct {

	// 租户.
	Tenant string `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"`
	// 当前页码
	CurPage int32 `protobuf:"varint,2,opt,name=cur_page,json=curPage,proto3" json:"cur_page,omitempty"`
	// 页尺寸
	PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// 排序名称
	OrderName string `protobuf:"bytes,4,opt,name=order_name,json=orderName,proto3" json:"order_name,omitempty"`
	// 是否升序排序
	OrderAsc bool `protobuf:"varint,5,opt,name=order_asc,json=orderAsc,proto3" json:"order_asc,omitempty"`
	// contains filtered or unexported fields
}

查询

func (*JmashFileReq) Descriptor deprecated

func (*JmashFileReq) Descriptor() ([]byte, []int)

Deprecated: Use JmashFileReq.ProtoReflect.Descriptor instead.

func (*JmashFileReq) GetCurPage

func (x *JmashFileReq) GetCurPage() int32

func (*JmashFileReq) GetOrderAsc

func (x *JmashFileReq) GetOrderAsc() bool

func (*JmashFileReq) GetOrderName

func (x *JmashFileReq) GetOrderName() string

func (*JmashFileReq) GetPageSize

func (x *JmashFileReq) GetPageSize() int32

func (*JmashFileReq) GetTenant

func (x *JmashFileReq) GetTenant() string

func (*JmashFileReq) ProtoMessage

func (*JmashFileReq) ProtoMessage()

func (*JmashFileReq) ProtoReflect

func (x *JmashFileReq) ProtoReflect() protoreflect.Message

func (*JmashFileReq) Reset

func (x *JmashFileReq) Reset()

func (*JmashFileReq) String

func (x *JmashFileReq) String() string

type UnimplementedFileServer

type UnimplementedFileServer struct {
}

UnimplementedFileServer must be embedded to have forward compatible implementations.

func (UnimplementedFileServer) BatchDeleteJmashFile

func (UnimplementedFileServer) DeleteJmashFile

func (UnimplementedFileServer) FindEnumList

func (UnimplementedFileServer) FindEnumMap

func (UnimplementedFileServer) FindJmashFileById

func (UnimplementedFileServer) FindJmashFileList

func (UnimplementedFileServer) FindJmashFilePage

type UnsafeFileServer

type UnsafeFileServer interface {
	// contains filtered or unexported methods
}

UnsafeFileServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to FileServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL