service

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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 Category

type Category struct {
}

func (*Category) CreateCategory

func (*Category) CreateCategory(name string) *model.Category

func (*Category) FindAll

func (*Category) FindAll() []model.Category

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 上传文件

Jump to

Keyboard shortcuts

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