baidubce

package
v0.0.0-...-e951c9a Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: AGPL-3.0 Imports: 12 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) IsObjectNotFoundErr

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

func (*BOSObjectStorage) List

func (*BOSObjectStorage) PutObject

func (b *BOSObjectStorage) PutObject(ctx context.Context, objectKey string, object io.ReadSeeker) 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