Documentation
¶
Index ¶
Constants ¶
View Source
const ( TypeOSS = "oss" TypeCOS = "cos" TypeS3 = "s3" )
存储类型常量
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Upload(ctx context.Context, key string, reader io.Reader, opts ...UploadOptionFunc) error
Download(ctx context.Context, key string, opts ...DownloadOptionFunc) (io.ReadCloser, error)
Delete(ctx context.Context, key string) error
Exists(ctx context.Context, key string) (bool, error)
Stat(ctx context.Context, key string) (*ObjectInfo, error)
SignedURL(ctx context.Context, key string, expire time.Duration, opts ...SignOptionFunc) (string, error)
InitMultipart(ctx context.Context, key string, opts ...UploadOptionFunc) (*MultipartUpload, error)
UploadPart(ctx context.Context, uploadID string, partNum int, reader io.Reader, opts ...UploadOptionFunc) (*PartInfo, error)
CompleteMultipart(ctx context.Context, uploadID string, parts []*PartInfo, opts ...UploadOptionFunc) error
AbortMultipart(ctx context.Context, uploadID string) error
DeleteBatch(ctx context.Context, keys []string) error
}
Client 存储客户端接口
type Config ¶
type Config struct {
Type string
AccessKeyID string
AccessKeySecret string
Bucket string
Region string
Endpoint string
DefaultSignExpire time.Duration
}
Config 存储配置
type MultipartUpload ¶
MultipartUpload 分片上传信息
Click to show internal directories.
Click to hide internal directories.