filesx

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Local     = "local"
	AmazonS3  = "s3"
	AliyunOSS = "oss"
	Qiniu     = "qiniu"
)

Variables

This section is empty.

Functions

func Must

func Must(configs ...config.StorageConfig)

Must 初始化上传管理器

Types

type Storage

type Storage interface {
	Upload(ctx context.Context, file io.Reader, path, contentType string) (string, error)
	Delete(ctx context.Context, path string) error
}

Storage 存储接口

type UploadManager

type UploadManager struct {
	// contains filtered or unexported fields
}

UploadManager 上传管理器

var (
	Uploader *UploadManager
)

func (*UploadManager) Delete

func (u *UploadManager) Delete(ctx context.Context, storageType string, path string) error

Delete 删除文件

func (*UploadManager) Upload

func (u *UploadManager) Upload(ctx context.Context, storageType string, file io.Reader, header *multipart.FileHeader) (string, error)

Upload 上传文件

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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