Documentation ¶
Overview ¶
Package s3blob implements the blob interfaces for S3.
Index ¶
- Variables
- type Bucket
- func (b *Bucket) Copy(ctx context.Context, src, dst string, contentHash string) error
- func (b *Bucket) CopyFrom(ctx context.Context, srcBucket blob.Bucket, src, dst string) error
- func (b *Bucket) Delete(ctx context.Context, keys ...string) (err error)
- func (b *Bucket) Download(ctx context.Context, key, etag string, size int64, w io.WriterAt) (int64, error)
- func (b *Bucket) File(ctx context.Context, key string) (reflow.File, error)
- func (b *Bucket) Get(ctx context.Context, key, etag string) (io.ReadCloser, reflow.File, error)
- func (b *Bucket) Location() string
- func (b *Bucket) Put(ctx context.Context, key string, size int64, body io.Reader, ...) error
- func (b *Bucket) Scan(prefix string, withMetadata bool) blob.Scanner
- func (b *Bucket) Snapshot(ctx context.Context, prefix string) (reflow.Fileset, error)
- type Store
Constants ¶
This section is empty.
Variables ¶
var DefaultRegion = "us-east-1"
DefaultRegion is the region used for s3 requests if a bucket's region is undiscoverable (e.g., lacking permissions for the GetBucketLocation API call.)
Amazon generally defaults to us-east-1 when regions are unspecified (or undiscoverable), but this can be overridden if a different default is desired.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
Bucket represents an s3 bucket; it implements blob.Bucket.
func NewBucket ¶
NewBucket returns a new S3 bucket that uses the provided client for SDK calls. NewBucket is primarily intended for testing.
func (*Bucket) Copy ¶
Copy copies the key src to the key dst. This is done directly without streaming the data through the client. If a non-empty contentHash is provided, it is stored in the object's metadata.
func (*Bucket) CopyFrom ¶
CopyFrom copies from bucket src and key srcKey into this bucket. This is done directly without streaming the data through the client.
func (*Bucket) Download ¶
func (b *Bucket) Download(ctx context.Context, key, etag string, size int64, w io.WriterAt) (int64, error)
Download downloads the object named by the provided key. Download uses the AWS SDK's download manager, performing concurrent downloads to the provided io.WriterAt.
func (*Bucket) Put ¶
func (b *Bucket) Put(ctx context.Context, key string, size int64, body io.Reader, contentHash string) error
Put stores the contents of the provided io.Reader at the provided key and attaches the given contentHash to the object's metadata.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements blob.Store for S3. Buckets in store correspond exactly with buckets in S3. Store manages region discovery and session maintenance so that S3 access can be treated uniformly across regions.