Documentation ¶
Index ¶
- type ListObjectsResult
- type ObjectMeta
- type ObjectProperties
- type Option
- func ContentType(contentType string) Option
- func Delimiter(delimiter string) Option
- func IsPrivate(isPrivate bool) Option
- func Limit(limit int) Option
- func Marker(marker string) Option
- func Prefix(prefix string) Option
- func Process(listener ProgressListener) Option
- func SessionToken(token string) Option
- func TokenExpiry(expiry int) Option
- type Options
- type OssClientIface
- type OssConfig
- type ProgressEvent
- type ProgressListener
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListObjectsResult ¶
type ListObjectsResult struct { Prefix string `json:"prefix"` Marker string `json:"marker"` Delimiter string `json:"delimiter"` IsTruncated bool `json:"is_truncated"` NextMarker string `json:"next_marker"` Objects []ObjectProperties `json:"objects"` CommonPrefixes []string `json:"common_prefixes"` }
type ObjectMeta ¶
type ObjectProperties ¶
type Options ¶
type Options struct { IsPrivate bool // 是否私有 ContentType string // 类型 Process ProgressListener // 进度 Prefix string // 前缀 Marker string // 标记 Delimiter string // 目录过滤 Limit int // 限制列表大小 TokenExpiry int // token过期时间 SessionToken string // 临时token }
Options oss的参数选项
type OssClientIface ¶
type OssClientIface interface { // Token 获取token Token(ctx context.Context, bucket string, objectKey string, opts ...Option) (*Token, error) // ObjectMeta 获取对象基本信息 ObjectMeta(ctx context.Context, bucket string, objectKey string, opts ...Option) (*ObjectMeta, error) // PutObject 上传对象 PutObject(ctx context.Context, bucket string, objectKey string, data io.Reader, size int64, opts ...Option) (string, error) // PutObjectFromFile 从本地文件上传对象 PutObjectFromFile(ctx context.Context, bucket string, objectKey string, filePath string, opts ...Option) (string, error) // BatchCopy 批量复制 BatchCopy(ctx context.Context, bucket string, copyKeys map[string]string, opts ...Option) error // GetObject 获取对象 GetObject(ctx context.Context, bucket string, objectKey string, opts ...Option) ([]byte, error) // Copy 复制对象 Copy(ctx context.Context, bucket string, srcObject string, dstObject string, opts ...Option) error // ListObjects 获取对象信息列表 ListObjects(ctx context.Context, bucket string, opts ...Option) (ListObjectsResult, error) // MakePrivateURL 创建私有URL MakePrivateURL(ctx context.Context, bucket string, key string, deadline int64, opts ...Option) (string, error) }
OssClientIface oss客户端
func NewAliClient ¶
func NewAliClient(opts OssConfig) OssClientIface
func NewMinioClient ¶
func NewMinioClient(opts OssConfig) OssClientIface
func NewQiniuClient ¶
func NewQiniuClient(opts OssConfig) OssClientIface
type ProgressEvent ¶
ProgressEvent defines progress event
type ProgressListener ¶
type ProgressListener interface {
ProgressChanged(event *ProgressEvent)
}
ProgressListener listens progress change
Click to show internal directories.
Click to hide internal directories.