Documentation ¶
Overview ¶
Package swift implements common object storage abstractions against OpenStack swift APIs.
Index ¶
- Constants
- Variables
- func NewTestContainer(t testing.TB) (objstore.Bucket, func(), error)
- type Config
- type Container
- func (c *Container) Attributes(_ context.Context, name string) (objstore.ObjectAttributes, error)
- func (*Container) Close() error
- func (c *Container) Delete(_ context.Context, name string) error
- func (c *Container) Exists(_ context.Context, name string) (bool, error)
- func (c *Container) Get(_ context.Context, name string) (io.ReadCloser, error)
- func (c *Container) GetRange(_ context.Context, name string, off, length int64) (io.ReadCloser, error)
- func (c *Container) IsAccessDeniedErr(err error) bool
- func (c *Container) IsObjNotFoundErr(err error) bool
- func (c *Container) Iter(ctx context.Context, dir string, f func(string) error, ...) error
- func (c *Container) IterWithAttributes(ctx context.Context, dir string, ...) error
- func (c *Container) Name() string
- func (c *Container) Provider() objstore.ObjProvider
- func (c *Container) SupportedIterOptions() []objstore.IterOptionType
- func (c *Container) Upload(_ context.Context, name string, r io.Reader) (err error)
Constants ¶
View Source
const ( // DirDelim is the delimiter used to model a directory structure in an object store bucket. DirDelim = '/' // SegmentsDir represent name of the directory in bucket, where to store file parts of SLO and DLO. SegmentsDir = "segments/" )
Variables ¶
Functions ¶
Types ¶
type Config ¶
type Config struct { AuthVersion int `yaml:"auth_version"` AuthUrl string `yaml:"auth_url"` Username string `yaml:"username"` UserDomainName string `yaml:"user_domain_name"` UserDomainID string `yaml:"user_domain_id"` UserId string `yaml:"user_id"` Password string `yaml:"password"` DomainId string `yaml:"domain_id"` DomainName string `yaml:"domain_name"` ApplicationCredentialID string `yaml:"application_credential_id"` ApplicationCredentialName string `yaml:"application_credential_name"` ApplicationCredentialSecret string `yaml:"application_credential_secret"` 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"` ChunkSize int64 `yaml:"large_object_chunk_size"` SegmentContainerName string `yaml:"large_object_segments_container_name"` Retries int `yaml:"retries"` ConnectTimeout model.Duration `yaml:"connect_timeout"` Timeout model.Duration `yaml:"timeout"` UseDynamicLargeObjects bool `yaml:"use_dynamic_large_objects"` HTTPConfig exthttp.HTTPConfig `yaml:"http_config"` }
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func NewContainer ¶
func NewContainer(logger log.Logger, conf []byte, wrapRoundtripper func(http.RoundTripper) http.RoundTripper) (*Container, error)
func NewContainerFromConfig ¶
func NewContainerFromConfig(logger log.Logger, sc *Config, createContainer bool, wrapRoundtripper func(http.RoundTripper) http.RoundTripper) (*Container, error)
func (*Container) Attributes ¶
Attributes returns information about the specified object.
func (*Container) IsAccessDeniedErr ¶
IsAccessDeniedErr returns true if access to object is denied.
func (*Container) IsObjNotFoundErr ¶
IsObjNotFoundErr returns true if error means that object is not found. Relevant to Get operations.
func (*Container) Iter ¶
func (c *Container) Iter(ctx context.Context, dir string, f func(string) error, options ...objstore.IterOption) error
Iter calls f for each entry in the given directory. The argument to f is the full object name including the prefix of the inspected directory.
func (*Container) IterWithAttributes ¶
func (c *Container) IterWithAttributes(ctx context.Context, dir string, f func(attrs objstore.IterObjectAttributes) error, options ...objstore.IterOption) error
func (*Container) Provider ¶
func (c *Container) Provider() objstore.ObjProvider
func (*Container) SupportedIterOptions ¶
func (c *Container) SupportedIterOptions() []objstore.IterOptionType
Click to show internal directories.
Click to hide internal directories.