Documentation ¶
Overview ¶
Package swift implements common object storage abstractions against OpenStack swift APIs.
Index ¶
- Constants
- func NewTestContainer(t testing.TB) (objstore.Bucket, func(), error)
- type Container
- func (*Container) Close() error
- func (c *Container) Delete(ctx context.Context, name string) error
- func (c *Container) Exists(ctx context.Context, name string) (bool, error)
- func (c *Container) Get(ctx context.Context, name string) (io.ReadCloser, error)
- func (c *Container) GetRange(ctx context.Context, name string, off, length int64) (io.ReadCloser, error)
- func (c *Container) IsObjNotFoundErr(err error) bool
- func (c *Container) Iter(ctx context.Context, dir string, f func(string) error) error
- func (c *Container) Name() string
- func (c *Container) ObjectSize(ctx context.Context, name string) (uint64, error)
- func (c *Container) Upload(ctx context.Context, name string, r io.Reader) error
- type SwiftConfig
Constants ¶
View Source
const DirDelim = "/"
DirDelim is the delimiter used to model a directory structure in an object store bucket.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func (*Container) GetRange ¶
func (c *Container) GetRange(ctx context.Context, name string, off, length int64) (io.ReadCloser, error)
GetRange returns a new range reader for the given object name and range.
func (*Container) IsObjNotFoundErr ¶
IsObjNotFoundErr returns true if error means that object is not found. Relevant to Get operations.
func (*Container) Iter ¶
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) ObjectSize ¶ added in v0.10.0
ObjectSize returns the size of the specified object.
type SwiftConfig ¶ added in v0.3.0
type SwiftConfig struct { 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"` 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"` }
Click to show internal directories.
Click to hide internal directories.