Documentation ¶
Index ¶
Constants ¶
View Source
const ( VolumeTypeLocal = "local" VolumeTypeS3 = "s3" VolumeTypeOss = "oss" VolumeTypeCos = "cos" )
Variables ¶
This section is empty.
Functions ¶
func NewLocalProvider ¶
Types ¶
type ListOption ¶
type VolumeProvider ¶
type VolumeProvider interface { // 供应商类型 GetProviderType() string GetFileUrl(ctx context.Context, path string) (string, error) // 大文件上传 HttpBigUpload(w http.ResponseWriter, r *http.Request) error // 上传文件 Upload(ctx context.Context, fileName string, data []byte) error // 删除文件 Delete(ctx context.Context, fileName string) error // 文件是否存在 Exists(ctx context.Context, path string) bool // 打开文件 Open(ctx context.Context, name string) (io.ReadWriteCloser, error) // 创建文件 Create(ctx context.Context, name string) (io.ReadWriteCloser, error) // 创建文件 CreateDir(ctx context.Context, name string) error // 遍历 Walk(path string, fn filepath.WalkFunc) error // 文件列表 List(ctx context.Context, req ListOption) ([]FileInfo, error) // 重命名 Rename(context.Context, string, string) error }
Click to show internal directories.
Click to hide internal directories.