Documentation
¶
Index ¶
- func IsRetryableErr(error) bool
- type HTTPConfig
- type SwiftConfig
- type SwiftObjectClient
- func (s *SwiftObjectClient) DeleteObject(ctx context.Context, objectKey string) error
- func (s *SwiftObjectClient) GetAttributes(ctx context.Context, objectKey string) (client.ObjectAttributes, error)
- func (s *SwiftObjectClient) GetObject(ctx context.Context, objectKey string) (io.ReadCloser, int64, error)
- func (s *SwiftObjectClient) GetObjectRange(ctx context.Context, objectKey string, offset, length int64) (io.ReadCloser, error)
- func (s *SwiftObjectClient) IsObjectNotFoundErr(err error) bool
- func (s *SwiftObjectClient) IsRetryableErr(err error) bool
- func (s *SwiftObjectClient) List(ctx context.Context, prefix, delimiter string) ([]client.StorageObject, []client.StorageCommonPrefix, error)
- func (s *SwiftObjectClient) ObjectExists(ctx context.Context, objectKey string) (bool, error)
- func (s *SwiftObjectClient) PutObject(ctx context.Context, objectKey string, object io.Reader) error
- func (s *SwiftObjectClient) Stop()
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRetryableErr ¶ added in v3.4.0
TODO(dannyk): implement for client
Types ¶
type HTTPConfig ¶ added in v3.4.0
type HTTPConfig struct {
Transport http.RoundTripper `yaml:"-"`
TLSConfig TLSConfig `yaml:",inline"`
}
Config stores the http.Client configuration for the storage clients.
type SwiftConfig ¶
type SwiftConfig struct {
AuthVersion int `yaml:"auth_version"`
AuthURL string `yaml:"auth_url"`
Internal bool `yaml:"internal"`
Username string `yaml:"username"`
UserDomainName string `yaml:"user_domain_name"`
UserDomainID string `yaml:"user_domain_id"`
UserID string `yaml:"user_id"`
Password flagext.Secret `yaml:"password"`
DomainID string `yaml:"domain_id"`
DomainName string `yaml:"domain_name"`
ProjectID string `yaml:"project_id"`
ProjectName string `yaml:"project_name"`
ProjectDomainID string `yaml:"project_domain_id"`
ProjectDomainName string `yaml:"project_domain_name"`
RegionName string `yaml:"region_name"`
ContainerName string `yaml:"container_name"`
MaxRetries int `yaml:"max_retries" category:"advanced"`
ConnectTimeout time.Duration `yaml:"connect_timeout" category:"advanced"`
RequestTimeout time.Duration `yaml:"request_timeout" category:"advanced"`
HTTP HTTPConfig `yaml:"http"`
}
SwiftConfig is config for the Swift Chunk Client.
func (*SwiftConfig) RegisterFlags ¶
func (cfg *SwiftConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags registers flags.
func (*SwiftConfig) RegisterFlagsWithPrefix ¶
func (cfg *SwiftConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
RegisterFlagsWithPrefix registers flags with prefix.
func (*SwiftConfig) Validate ¶
func (cfg *SwiftConfig) Validate() error
Validate config and returns error on failure
type SwiftObjectClient ¶
type SwiftObjectClient struct {
// contains filtered or unexported fields
}
func NewSwiftObjectClient ¶
func NewSwiftObjectClient(cfg SwiftConfig, hedgingCfg hedging.Config) (*SwiftObjectClient, error)
NewSwiftObjectClient makes a new chunk.Client that writes chunks to OpenStack Swift.
func (*SwiftObjectClient) DeleteObject ¶
func (s *SwiftObjectClient) DeleteObject(ctx context.Context, objectKey string) error
DeleteObject deletes the specified object key from the configured Swift container.
func (*SwiftObjectClient) GetAttributes ¶ added in v3.3.0
func (s *SwiftObjectClient) GetAttributes(ctx context.Context, objectKey string) (client.ObjectAttributes, error)
func (*SwiftObjectClient) GetObject ¶
func (s *SwiftObjectClient) GetObject(ctx context.Context, objectKey string) (io.ReadCloser, int64, error)
GetObject returns a reader and the size for the specified object key from the configured swift container.
func (*SwiftObjectClient) GetObjectRange ¶ added in v3.2.0
func (s *SwiftObjectClient) GetObjectRange(ctx context.Context, objectKey string, offset, length int64) (io.ReadCloser, error)
GetObject returns a reader and the size for the specified object key from the configured swift container.
func (*SwiftObjectClient) IsObjectNotFoundErr ¶
func (s *SwiftObjectClient) IsObjectNotFoundErr(err error) bool
IsObjectNotFoundErr returns true if error means that object is not found. Relevant to GetObject and DeleteObject operations.
func (*SwiftObjectClient) IsRetryableErr ¶
func (s *SwiftObjectClient) IsRetryableErr(err error) bool
func (*SwiftObjectClient) List ¶
func (s *SwiftObjectClient) List(ctx context.Context, prefix, delimiter string) ([]client.StorageObject, []client.StorageCommonPrefix, error)
List only objects from the store non-recursively
func (*SwiftObjectClient) ObjectExists ¶
func (*SwiftObjectClient) PutObject ¶
func (s *SwiftObjectClient) PutObject(ctx context.Context, objectKey string, object io.Reader) error
PutObject puts the specified bytes into the configured Swift container at the provided key
func (*SwiftObjectClient) Stop ¶
func (s *SwiftObjectClient) Stop()