buckets

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
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
}

func (*AliyunDrive) Exists

func (t *AliyunDrive) Exists(ctx context.Context, path string) bool

func (*AliyunDrive) Info

func (t *AliyunDrive) Info(ctx context.Context) (interface{}, error)

func (*AliyunDrive) Put

func (t *AliyunDrive) Put(ctx context.Context, localFile, key string) error

type COSBucket

type COSBucket struct {
	Config *obsync.BucketConfig
	Client *cos.Client
}

func (COSBucket) Exists

func (t COSBucket) Exists(ctx context.Context, path string) bool

Exists to check if the path exists in the bucket

func (COSBucket) Info

func (t COSBucket) Info(ctx context.Context) (interface{}, error)

Info to get bucket information

func (COSBucket) Put

func (t COSBucket) Put(ctx context.Context, localFile, key string) error

Put to upload local file to bucket within specified key

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

func (*MinioBucket) Info

func (r *MinioBucket) Info(ctx context.Context) (interface{}, error)

Info to get the buckets info

func (*MinioBucket) Put

func (r *MinioBucket) Put(ctx context.Context, localPath, key string) error

Put to put the file to the buckets

type OBSBucket

type OBSBucket struct {
	Client *obs.ObsClient
	Config *obsync.BucketConfig
}

OBSBucket struct for obs client

func (*OBSBucket) Exists

func (o *OBSBucket) Exists(_ context.Context, path string) bool

Exists detect object whether exists

func (*OBSBucket) Info

func (o *OBSBucket) Info(_ context.Context) (interface{}, error)

Info get obs buckets info

func (*OBSBucket) Put

func (o *OBSBucket) Put(_ context.Context, localFile, key string) error

Put a file to obs buckets

type OSSBucket

type OSSBucket struct {
	Client *oss.Client
	Config *obsync.BucketConfig
}

func (*OSSBucket) Exists

func (o *OSSBucket) Exists(_ context.Context, path string) bool

func (*OSSBucket) GetBucket

func (o *OSSBucket) GetBucket() (*oss.Bucket, error)

func (*OSSBucket) Info

func (o *OSSBucket) Info(_ context.Context) (result interface{}, err error)

func (*OSSBucket) Put

func (o *OSSBucket) Put(_ context.Context, localFile, key string) (err error)

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

func (r *QingBucket) PartsCount(path string, chunkSize int) (parts int, size int, err error)

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

func (*S3Bucket) Exists

func (r *S3Bucket) Exists(ctx context.Context, path string) bool

Exists to check if the file exists

func (*S3Bucket) Info

func (r *S3Bucket) Info(ctx context.Context) (interface{}, error)

Info to get the buckets info

func (*S3Bucket) Put

func (r *S3Bucket) Put(ctx context.Context, localPath, key string) error

Put to put the file to the 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

func (*TestBucket) Info

func (r *TestBucket) Info(ctx context.Context) (interface{}, error)

Info to get the buckets info

func (*TestBucket) Put

func (r *TestBucket) Put(ctx context.Context, path, key string) error

Put to put the file to the buckets

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

func (UpyunBucket) Info

func (t UpyunBucket) Info(_ context.Context) (interface{}, error)

Info returns information about the buckets

func (UpyunBucket) Put

func (t UpyunBucket) Put(ctx context.Context, filePath, key string) (err error)

Put to update local file to bucket with specified key

Jump to

Keyboard shortcuts

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