object_storage

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrObjectKeyEmpty  = errors.New("object key is empty")
	ErrBucketNameEmpty = errors.New("bucket name is empty")
	ErrObjectNotFound  = errors.New("object is not found")
)

Functions

This section is empty.

Types

type AWSObjectStorageService

type AWSObjectStorageService struct {
	// contains filtered or unexported fields
}

func (*AWSObjectStorageService) DeleteObject

func (service *AWSObjectStorageService) DeleteObject(ctx context.Context, key string) error

func (*AWSObjectStorageService) DeleteObjects

func (service *AWSObjectStorageService) DeleteObjects(ctx context.Context, keys ...string) error

func (*AWSObjectStorageService) GetObject

func (service *AWSObjectStorageService) GetObject(ctx context.Context, key string) (Object, error)

func (*AWSObjectStorageService) GetSignedURL

func (service *AWSObjectStorageService) GetSignedURL(key string, duration time.Duration) (string, error)

func (*AWSObjectStorageService) GetSignedURLForExistedKey added in v1.1.1

func (service *AWSObjectStorageService) GetSignedURLForExistedKey(ctx context.Context, key string, duration time.Duration) (string, error)

func (*AWSObjectStorageService) HeadObject added in v1.1.1

func (service *AWSObjectStorageService) HeadObject(ctx context.Context, key string) (Object, error)

func (*AWSObjectStorageService) ListObjects

func (service *AWSObjectStorageService) ListObjects(ctx context.Context, prefix string, continueToken *string, maxObjects int) ([]Object, *string, error)

func (*AWSObjectStorageService) PutObject

func (service *AWSObjectStorageService) PutObject(ctx context.Context, key string, body []byte) error

type Object

type Object struct {
	// contains filtered or unexported fields
}

func (Object) GetContent

func (object Object) GetContent() ([]byte, error)

func (Object) GetKey

func (object Object) GetKey() string

func (Object) GetModifiedTime

func (object Object) GetModifiedTime() time.Time

func (Object) GetObjectSize added in v1.1.1

func (object Object) GetObjectSize() int64

type ObjectStorageService

type ObjectStorageService interface {
	ListObjects(ctx context.Context, prefix string, continueToken *string, maxObjects int) ([]Object, *string, error)
	HeadObject(ctx context.Context, key string) (Object, error)
	GetObject(ctx context.Context, key string) (Object, error)
	PutObject(ctx context.Context, key string, body []byte) error
	DeleteObject(ctx context.Context, key string) error
	DeleteObjects(ctx context.Context, keys ...string) error
	GetSignedURL(key string, duration time.Duration) (string, error)
	//GetSignedURLForExistedKey generates signed url if key exists. If key does not exist, return error
	GetSignedURLForExistedKey(ctx context.Context, key string, duration time.Duration) (string, error)
}

func GetAWSObjectService

func GetAWSObjectService(bucketName string, option cloud.Option) (ObjectStorageService, error)

func GetObjectStorageService

func GetObjectStorageService(bucketName string, option cloud.Option) (ObjectStorageService, error)

func GetTencentCloudObjectService

func GetTencentCloudObjectService(bucketName string, option cloud.Option) (ObjectStorageService, error)

type TencentCloudObjectStorageService

type TencentCloudObjectStorageService struct {
	// contains filtered or unexported fields
}

func (*TencentCloudObjectStorageService) DeleteObject

func (service *TencentCloudObjectStorageService) DeleteObject(ctx context.Context, key string) error

func (*TencentCloudObjectStorageService) DeleteObjects

func (service *TencentCloudObjectStorageService) DeleteObjects(ctx context.Context, keys ...string) error

func (*TencentCloudObjectStorageService) GetObject

func (service *TencentCloudObjectStorageService) GetObject(ctx context.Context, key string) (Object, error)

func (*TencentCloudObjectStorageService) GetSignedURL

func (service *TencentCloudObjectStorageService) GetSignedURL(key string, duration time.Duration) (string, error)

func (*TencentCloudObjectStorageService) GetSignedURLForExistedKey added in v1.1.1

func (service *TencentCloudObjectStorageService) GetSignedURLForExistedKey(ctx context.Context, key string, duration time.Duration) (string, error)

func (*TencentCloudObjectStorageService) HeadObject added in v1.1.1

func (service *TencentCloudObjectStorageService) HeadObject(ctx context.Context, key string) (Object, error)

func (*TencentCloudObjectStorageService) ListObjects

func (service *TencentCloudObjectStorageService) ListObjects(ctx context.Context, prefix string, continueToken *string, maxObjects int) ([]Object, *string, error)

func (*TencentCloudObjectStorageService) PutObject

func (service *TencentCloudObjectStorageService) PutObject(ctx context.Context, key string, body []byte) error

Jump to

Keyboard shortcuts

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