Documentation ¶
Index ¶
- Constants
- type AliyunDrive
- type COSBucket
- type MinioBucket
- type OBSBucket
- type OSSBucket
- type QiNiuBucket
- type QingBucket
- func (r *QingBucket) AbortMultiUpload(objectKey string, uploadID *string) error
- func (r *QingBucket) CompleteMultiParts(filepath string, objectKey string, uploadID *string, ...) (err error)
- func (r *QingBucket) Del(_ context.Context, key string) error
- func (r *QingBucket) Exists(_ context.Context, path string) bool
- func (r *QingBucket) Info(_ context.Context) (interface{}, error)
- func (r *QingBucket) InitUploadID(key string) (*string, error)
- func (r *QingBucket) ListMultiParts(objectKey string, uploadID *string) ([]*qingService.ObjectPartType, error)
- func (r *QingBucket) PartsCount(path string, chunkSize int) (parts int, size int, err error)
- func (r *QingBucket) Put(ctx context.Context, path, key string) error
- func (r *QingBucket) PutDirectly(_ context.Context, path, key string) error
- func (r *QingBucket) PutMultipart(_ context.Context, filePath, objectKey string) (err error)
- type S3Bucket
- type TestBucket
- type UpyunBucket
Constants ¶
const MaxChunkSize = 50 * (1 << 20) // 50 mb
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AliyunDrive ¶
type AliyunDrive struct { Config *obsync.BucketConfig DefaultDriveID string // contains filtered or unexported fields }
type COSBucket ¶
type COSBucket struct { Config *obsync.BucketConfig Client *cos.Client }
type MinioBucket ¶
type MinioBucket struct { Config *obsync.BucketConfig Client *minio.Client }
MinioBucket is a test buckets
func (*MinioBucket) Exists ¶
func (r *MinioBucket) Exists(ctx context.Context, path string) bool
Exists to check if the file exists
type OBSBucket ¶
type OBSBucket struct { Client *obs.ObsClient Config *obsync.BucketConfig }
OBSBucket struct for obs client
type OSSBucket ¶
type OSSBucket struct { Client *oss.Client Config *obsync.BucketConfig }
type QiNiuBucket ¶
type QiNiuBucket struct { Config *obsync.BucketConfig Mac *qbox.Mac }
QiNiuBucket implements buckets.Bucket interface
func (QiNiuBucket) Exists ¶
func (t QiNiuBucket) Exists(ctx context.Context, path string) bool
Exists to check if specified path is existed
func (QiNiuBucket) Info ¶
func (t QiNiuBucket) Info(ctx context.Context) (interface{}, error)
Info implements form buckets.Bucket interface
func (QiNiuBucket) Put ¶
func (t QiNiuBucket) Put(ctx context.Context, localFile, key string) (err error)
Put to upload local file into bucket within specified key
func (QiNiuBucket) UploadToken ¶
func (t QiNiuBucket) UploadToken(key string) string
UploadToken to update the key from specified scope
type QingBucket ¶
type QingBucket struct { Config *obsync.BucketConfig // contains filtered or unexported fields }
QingBucket is a bucket for qingcloud storage
func NewQingClient ¶
func NewQingClient(config obsync.BucketConfig) (*QingBucket, error)
NewQingClient to instance a new client for qingcloud object-storage service
func (*QingBucket) AbortMultiUpload ¶
func (r *QingBucket) AbortMultiUpload(objectKey string, uploadID *string) error
func (*QingBucket) CompleteMultiParts ¶
func (r *QingBucket) CompleteMultiParts(filepath string, objectKey string, uploadID *string, parts []*qingService.ObjectPartType) (err error)
CompleteMultiParts to complete multipart upload request with parts
func (*QingBucket) Del ¶
func (r *QingBucket) Del(_ context.Context, key string) error
Del to delete a object from the bucket
func (*QingBucket) Exists ¶
func (r *QingBucket) Exists(_ context.Context, path string) bool
Exists to check if the file exists
func (*QingBucket) Info ¶
func (r *QingBucket) Info(_ context.Context) (interface{}, error)
Info to get the buckets info
func (*QingBucket) InitUploadID ¶
func (r *QingBucket) InitUploadID(key string) (*string, error)
func (*QingBucket) ListMultiParts ¶
func (r *QingBucket) ListMultiParts(objectKey string, uploadID *string) ([]*qingService.ObjectPartType, error)
ListMultiParts to list multiple parts of a multipart upload request https://docs.qingcloud.com/qingstor/api/object/multipart/list_multipart.html
func (*QingBucket) PartsCount ¶
PartsCount return a file(from path) can be split to how many parts(depends on chunkSize) and file size.
func (*QingBucket) Put ¶
func (r *QingBucket) Put(ctx context.Context, path, key string) error
Put to upload file to bucket
func (*QingBucket) PutDirectly ¶
func (r *QingBucket) PutDirectly(_ context.Context, path, key string) error
PutDirectly to put the contents directly
func (*QingBucket) PutMultipart ¶
func (r *QingBucket) PutMultipart(_ context.Context, filePath, objectKey string) (err error)
type S3Bucket ¶
type S3Bucket struct { Config *obsync.BucketConfig Client *s3.S3 }
MinioBucket is a test buckets
type TestBucket ¶
type TestBucket struct {
Config *obsync.BucketConfig
}
TestBucket is a test buckets
func (*TestBucket) Exists ¶
func (r *TestBucket) Exists(ctx context.Context, path string) bool
Exists to check if the file exists
type UpyunBucket ¶
type UpyunBucket struct { Config *obsync.BucketConfig Client *upyun.UpYun }
UpyunBucket is a buckets implementation for Upyun
func (UpyunBucket) Exists ¶
func (t UpyunBucket) Exists(_ context.Context, path string) bool
Exists to check if specified path exists