Documentation ¶
Index ¶
- Constants
- type BOSObjectStorage
- func (b *BOSObjectStorage) DeleteObject(ctx context.Context, objectKey string) error
- func (b *BOSObjectStorage) GetAttributes(ctx context.Context, objectKey string) (client.ObjectAttributes, error)
- func (b *BOSObjectStorage) GetObject(ctx context.Context, objectKey string) (io.ReadCloser, int64, error)
- func (b *BOSObjectStorage) GetObjectRange(ctx context.Context, objectKey string, offset, length int64) (io.ReadCloser, error)
- func (b *BOSObjectStorage) IsObjectNotFoundErr(err error) bool
- func (b *BOSObjectStorage) IsRetryableErr(error) bool
- func (b *BOSObjectStorage) List(ctx context.Context, prefix string, delimiter string) ([]client.StorageObject, []client.StorageCommonPrefix, error)
- func (b *BOSObjectStorage) ObjectExists(ctx context.Context, objectKey string) (bool, error)
- func (b *BOSObjectStorage) PutObject(ctx context.Context, objectKey string, object io.Reader) 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) GetAttributes ¶ added in v3.3.0
func (b *BOSObjectStorage) GetAttributes(ctx context.Context, objectKey string) (client.ObjectAttributes, 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 (b *BOSObjectStorage) List(ctx context.Context, prefix string, delimiter string) ([]client.StorageObject, []client.StorageCommonPrefix, error)
func (*BOSObjectStorage) ObjectExists ¶
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.