Documentation
¶
Index ¶
- func UseCloudFileManager(fm CloudFileManager) error
- type AliOssFileManager
- type Category
- type CloudFileManager
- type FileService
- func (s *FileService) Download(id int, folder, filename string) (string, error)
- func (s *FileService) FindByCategoryID(categoryID uint) []model.File
- func (s *FileService) FindByFuzz(f model.FileDTO) []model.FileDTO
- func (s *FileService) SyncDBFile(command string) error
- func (s *FileService) UploadLocalFile(file, fileName, category string) (*model.File, error)
- type OssProgressListener
- type QiNiuFileManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UseCloudFileManager ¶
func UseCloudFileManager(fm CloudFileManager) error
Types ¶
type AliOssFileManager ¶
type AliOssFileManager struct {
}
AliOssFileManager 实现了 CloudFileManager 接口
func (*AliOssFileManager) Delete ¶
func (fm *AliOssFileManager) Delete(path string) error
func (*AliOssFileManager) Download ¶
func (fm *AliOssFileManager) Download(path, filename string) error
func (*AliOssFileManager) Move ¶
func (fm *AliOssFileManager) Move(path, p string) error
func (*AliOssFileManager) Upload ¶
func (fm *AliOssFileManager) Upload(file, fileName, category string) error
Upload 上传文件
type CloudFileManager ¶
type CloudFileManager interface {
// Upload 上传文件
Upload(file, fileName, category string) error
// Delete 删除文件
Delete(path string) error
// Download 删除文件
Download(path, filename string) error
// Move 移动文件,重命名文件
Move(oldPath, newPath string) error
}
CloudFileManager 文件管理
type FileService ¶
type FileService struct {
}
func (*FileService) Download ¶
func (s *FileService) Download(id int, folder, filename string) (string, error)
func (*FileService) FindByCategoryID ¶
func (s *FileService) FindByCategoryID(categoryID uint) []model.File
func (*FileService) FindByFuzz ¶
func (s *FileService) FindByFuzz(f model.FileDTO) []model.FileDTO
func (*FileService) SyncDBFile ¶
func (s *FileService) SyncDBFile(command string) error
func (*FileService) UploadLocalFile ¶
func (s *FileService) UploadLocalFile(file, fileName, category string) (*model.File, error)
UploadLocalFile 上传本地文件
type OssProgressListener ¶
type OssProgressListener struct {
}
OssProgressListener 定义进度条监听器。
func (*OssProgressListener) ProgressChanged ¶
func (listener *OssProgressListener) ProgressChanged(event *oss.ProgressEvent)
定义进度变更事件处理函数。
type QiNiuFileManager ¶
type QiNiuFileManager struct {
Endpoint string
AccessKeyID string
AccessKeySecret string
Options oss.ClientOption
}
QiNiuFileManager 实现了 CloudFileManager 接口
func (*QiNiuFileManager) Delete ¶
func (oss *QiNiuFileManager) Delete(path string) error
func (*QiNiuFileManager) Move ¶
func (oss *QiNiuFileManager) Move(path, p string) error
func (*QiNiuFileManager) Upload ¶
func (oss *QiNiuFileManager) Upload(file, fileName, category string) error
Upload 上传文件
Click to show internal directories.
Click to hide internal directories.