Documentation ¶
Index ¶
- Constants
- type DirectoryLimit
- type File
- type GetFileRequest
- type ListFileRequest
- type PrepareUploadFileReply
- type PrepareUploadFileRequest
- type Repo
- type UploadFileReply
- type UploadFileRequest
- type UseCase
- func (u *UseCase) DeleteFile(ctx kratosx.Context, ids []uint32) (uint32, error)
- func (u *UseCase) GetFile(ctx kratosx.Context, req *GetFileRequest) (*File, error)
- func (u *UseCase) ListFile(ctx kratosx.Context, req *ListFileRequest) ([]*File, uint32, error)
- func (u *UseCase) PrepareUploadFile(ctx kratosx.Context, req *PrepareUploadFileRequest) (*PrepareUploadFileReply, error)
- func (u *UseCase) UpdateFile(ctx kratosx.Context, req *File) error
- func (u *UseCase) UploadFile(ctx kratosx.Context, req *UploadFileRequest) (*UploadFileReply, error)
- func (u *UseCase) VerifyURL(key string, expire string, sign string) error
Constants ¶
View Source
const ( STATUS_PROGRESS = "PROGRESS" STATUS_COMPLETED = "COMPLETED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirectoryLimit ¶ added in v1.0.11
type File ¶
type File struct { Id uint32 `json:"id"` DirectoryId uint32 `json:"directoryId"` Name string `json:"name"` Type string `json:"type"` Size uint32 `json:"size"` Sha string `json:"sha"` Key string `json:"key"` Src string `json:"src"` URL string `json:"url"` Status string `json:"status"` UploadId string `json:"uploadId"` ChunkCount uint32 `json:"chunkCount"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` }
type GetFileRequest ¶
type ListFileRequest ¶ added in v1.0.11
type PrepareUploadFileReply ¶
type PrepareUploadFileReply struct { Uploaded bool `json:"uploaded"` Src *string `json:"src"` ChunkSize *uint32 `json:"chunkSize"` ChunkCount *uint32 `json:"chunkCount"` UploadId *string `json:"uploadId"` UploadChunks []uint32 `json:"uploadChunks"` Sha *string `json:"sha"` URL *string `json:"url"` }
type Repo ¶
type Repo interface { // GetFile 获取指定的文件信息 GetFile(ctx kratosx.Context, id uint32) (*File, error) // GetFileBySha 获取指定的文件信息 GetFileBySha(ctx kratosx.Context, sha string) (*File, error) // GetFileByUploadId 获取指定的文件信息 GetFileByUploadId(ctx kratosx.Context, uid string) (*File, error) // GetFileBySrc 获取指定的文件信息 GetFileBySrc(ctx kratosx.Context, src string) (*File, error) // ListFile 获取文件信息列表 ListFile(ctx kratosx.Context, req *ListFileRequest) ([]*File, uint32, error) // CreateFile 创建文件信息 CreateFile(ctx kratosx.Context, req *File) (uint32, error) // CopyFile 复制文件信息 CopyFile(ctx kratosx.Context, src *File, directoryId uint32, fileName string) error // UpdateFile 更新文件信息 UpdateFile(ctx kratosx.Context, req *File) error // UpdateFileStatus 更新文 件状态 UpdateFileStatus(ctx kratosx.Context, id uint32, status string) error // DeleteFile 删除文件信息 DeleteFile(ctx kratosx.Context, ids []uint32) (uint32, error) // GetDirectoryLimitByPath 获取指定的path上传限制信息 GetDirectoryLimitByPath(ctx kratosx.Context, paths []string) (*DirectoryLimit, error) // GetDirectoryLimitById 获取指定的id上传限制信息 GetDirectoryLimitById(ctx kratosx.Context, id uint32) (*DirectoryLimit, error) // GetStore 获取上传器 GetStore() store.Store }
type UploadFileReply ¶
type UploadFileRequest ¶
type UseCase ¶
type UseCase struct {
// contains filtered or unexported fields
}
func (*UseCase) DeleteFile ¶ added in v1.0.11
DeleteFile 删除文件信息
func (*UseCase) PrepareUploadFile ¶
func (u *UseCase) PrepareUploadFile(ctx kratosx.Context, req *PrepareUploadFileRequest) (*PrepareUploadFileReply, error)
PrepareUploadFile 预上传文件信息
func (*UseCase) UpdateFile ¶
UpdateFile 更新文件信息
func (*UseCase) UploadFile ¶
func (u *UseCase) UploadFile(ctx kratosx.Context, req *UploadFileRequest) (*UploadFileReply, error)
UploadFile 上传文件信息
Click to show internal directories.
Click to hide internal directories.