Documentation ¶
Index ¶
- Constants
- type BOSObjectStorage
- func (b *BOSObjectStorage) DeleteObject(ctx context.Context, objectKey string) error
- func (b *BOSObjectStorage) GetObject(ctx context.Context, objectKey string) (io.ReadCloser, int64, error)
- func (b *BOSObjectStorage) IsObjectNotFoundErr(err error) bool
- func (b *BOSObjectStorage) List(ctx context.Context, prefix string, delimiter string) ([]client.StorageObject, []client.StorageCommonPrefix, error)
- func (b *BOSObjectStorage) PutObject(ctx context.Context, objectKey string, object io.ReadSeeker) error
- func (b *BOSObjectStorage) Stop()
- type BOSStorageConfig
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 (b *BOSObjectStorage) List(ctx context.Context, prefix string, delimiter string) ([]client.StorageObject, []client.StorageCommonPrefix, error)
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
Click to show internal directories.
Click to hide internal directories.