baidubce

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultEndpoint = bos.DEFAULT_SERVICE_DOMAIN
View Source
const NoSuchKeyErr = "NoSuchKey"

NoSuchKeyErr The resource you requested does not exist. refer to: https://cloud.baidu.com/doc/BOS/s/Ajwvysfpl

https://intl.cloud.baidu.com/doc/BOS/s/Ajwvysfpl-en

Variables

This section is empty.

Functions

This section is empty.

Types

type BOSObjectStorage

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

func NewBOSObjectStorage

func NewBOSObjectStorage(cfg *BOSStorageConfig) (*BOSObjectStorage, error)

func (*BOSObjectStorage) DeleteObject

func (b *BOSObjectStorage) DeleteObject(ctx context.Context, objectKey string) error

func (*BOSObjectStorage) GetObject

func (b *BOSObjectStorage) GetObject(ctx context.Context, objectKey string) (io.ReadCloser, int64, error)

func (*BOSObjectStorage) GetObjectRange added in v3.2.0

func (b *BOSObjectStorage) GetObjectRange(ctx context.Context, objectKey string, offset, length int64) (io.ReadCloser, error)

func (*BOSObjectStorage) IsObjectNotFoundErr

func (b *BOSObjectStorage) IsObjectNotFoundErr(err error) bool

func (*BOSObjectStorage) IsRetryableErr

func (b *BOSObjectStorage) IsRetryableErr(error) bool

TODO(dannyk): implement for client

func (*BOSObjectStorage) List

func (*BOSObjectStorage) ObjectExists

func (b *BOSObjectStorage) ObjectExists(ctx context.Context, objectKey string) (bool, error)

func (*BOSObjectStorage) PutObject

func (b *BOSObjectStorage) PutObject(ctx context.Context, objectKey string, object io.Reader) error

func (*BOSObjectStorage) Stop

func (b *BOSObjectStorage) Stop()

type BOSStorageConfig

type BOSStorageConfig struct {
	BucketName      string         `yaml:"bucket_name"`
	Endpoint        string         `yaml:"endpoint"`
	AccessKeyID     string         `yaml:"access_key_id"`
	SecretAccessKey flagext.Secret `yaml:"secret_access_key"`
}

func (*BOSStorageConfig) RegisterFlags

func (cfg *BOSStorageConfig) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to config this to the given FlagSet

func (*BOSStorageConfig) RegisterFlagsWithPrefix

func (cfg *BOSStorageConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)

RegisterFlagsWithPrefix adds the flags required to config this to the given FlagSet

Jump to

Keyboard shortcuts

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