Documentation
¶
Overview ¶
Package storage provides a portable storage bucket API with cross-cutting concerns.
Index ¶
- type Bucket
- func (b *Bucket) CopyObject(ctx context.Context, dstBucket, dstKey string, src driver.CopySource) error
- func (b *Bucket) CreateBucket(ctx context.Context, name string) error
- func (b *Bucket) DeleteBucket(ctx context.Context, name string) error
- func (b *Bucket) DeleteObject(ctx context.Context, bucket, key string) error
- func (b *Bucket) GetObject(ctx context.Context, bucket, key string) (*driver.Object, error)
- func (b *Bucket) HeadObject(ctx context.Context, bucket, key string) (*driver.ObjectInfo, error)
- func (b *Bucket) ListBuckets(ctx context.Context) ([]driver.BucketInfo, error)
- func (b *Bucket) ListObjects(ctx context.Context, bucket string, opts driver.ListOptions) (*driver.ListResult, error)
- func (b *Bucket) PutObject(ctx context.Context, bucket, key string, data []byte, contentType string, ...) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
Bucket is the portable storage type wrapping a driver with cross-cutting concerns.
func (*Bucket) CopyObject ¶
func (b *Bucket) CopyObject(ctx context.Context, dstBucket, dstKey string, src driver.CopySource) error
CopyObject copies an object between buckets.
func (*Bucket) CreateBucket ¶
CreateBucket creates a new storage bucket.
func (*Bucket) DeleteBucket ¶
DeleteBucket deletes a storage bucket.
func (*Bucket) DeleteObject ¶
DeleteObject deletes an object from a bucket.
func (*Bucket) HeadObject ¶
HeadObject retrieves object metadata without the body.
func (*Bucket) ListBuckets ¶
ListBuckets lists all buckets.
func (*Bucket) ListObjects ¶
func (b *Bucket) ListObjects(ctx context.Context, bucket string, opts driver.ListOptions) (*driver.ListResult, error)
ListObjects lists objects in a bucket.
type Option ¶
type Option func(*Bucket)
Option configures a portable Bucket.
func WithErrorInjection ¶
WithErrorInjection sets the error injector.
func WithMetrics ¶
WithMetrics sets the metrics collector.
func WithRateLimiter ¶
WithRateLimiter sets the rate limiter.
Click to show internal directories.
Click to hide internal directories.