Documentation ¶
Index ¶
- Variables
- func FromBucketNameContext(ctx context.Context) (bucketName string, ok bool)
- func FromContentTypeContext(ctx context.Context) (contentType string, ok bool)
- func NewBucketNameContext(ctx context.Context, bucketName string) context.Context
- func NewContentTypeContext(ctx context.Context, contentType string) context.Context
- type AliyunOssStorage
- func (ds *AliyunOssStorage) CheckAndCreateBucket(bucketName string) (err error)
- func (ds *AliyunOssStorage) Download(ctx context.Context, dist io.Writer, filename string) (info storage.DownloadFileInfoer, err error)
- func (ds *AliyunOssStorage) Exist(ctx context.Context, filename string) (exist bool, err error)
- func (ds *AliyunOssStorage) Remove(ctx context.Context, filename string) (err error)
- func (ds *AliyunOssStorage) Upload(ctx context.Context, read io.Reader, filename string) (fullName string, err error)
- type MinioStorage
- func (ds *MinioStorage) CheckAndCreateBucket(bucketName string) (err error)
- func (ds *MinioStorage) Download(ctx context.Context, dist io.Writer, filename string) (info storage.DownloadFileInfoer, err error)
- func (ds *MinioStorage) Exist(ctx context.Context, filename string) (exist bool, err error)
- func (ds *MinioStorage) Remove(ctx context.Context, filename string) (err error)
- func (ds *MinioStorage) Upload(ctx context.Context, read io.Reader, filename string) (fullName string, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBucketNameNotIsNil 桶名称不能为空 ErrBucketNameNotIsNil = errors.New("BucketName not is nil") )
Functions ¶
func FromBucketNameContext ¶
FromBucketNameContext ...
func FromContentTypeContext ¶
FromContentTypeContext ...
func NewBucketNameContext ¶
NewBucketNameContext ...
Types ¶
type AliyunOssStorage ¶
type AliyunOssStorage struct { CheckAndCreateBucketEnabled bool // contains filtered or unexported fields }
AliyunOssStorage 阿里云oss存储
func NewAliyunOssStorage ¶
func NewAliyunOssStorage(ossClient *oss.Client, initBucket bool, bucketNames []string) (os *AliyunOssStorage, err error)
NewAliyunOssStorage 创建阿里云oss存储
func (*AliyunOssStorage) CheckAndCreateBucket ¶
func (ds *AliyunOssStorage) CheckAndCreateBucket(bucketName string) (err error)
CheckAndCreateBucket 检查并创建桶
func (*AliyunOssStorage) Download ¶
func (ds *AliyunOssStorage) Download(ctx context.Context, dist io.Writer, filename string) (info storage.DownloadFileInfoer, err error)
Download 下载
type MinioStorage ¶
type MinioStorage struct { CheckAndCreateBucketEnabled bool // contains filtered or unexported fields }
MinioStorage minio存储
func NewMinioStorage ¶
func NewMinioStorage(minioClient *minio.Client, location string, initBucket bool, bucketNames []string) (ms *MinioStorage, err error)
NewMinioStorage 创建minio存储
func (*MinioStorage) CheckAndCreateBucket ¶
func (ds *MinioStorage) CheckAndCreateBucket(bucketName string) (err error)
CheckAndCreateBucket 检查并创建桶
func (*MinioStorage) Download ¶
func (ds *MinioStorage) Download(ctx context.Context, dist io.Writer, filename string) (info storage.DownloadFileInfoer, err error)
Download 下载
Click to show internal directories.
Click to hide internal directories.