Documentation ¶
Overview ¶
Package s3store implements the blob.StoreCloser interface on Amazon S3.
Index ¶
- func Opener(_ context.Context, addr string) (blob.StoreCloser, error)
- type KV
- func (s KV) Delete(ctx context.Context, key string) error
- func (s KV) Get(ctx context.Context, key string) ([]byte, error)
- func (s KV) Has(ctx context.Context, keys ...string) (blob.KeySet, error)
- func (s KV) Len(ctx context.Context) (int64, error)
- func (s KV) List(ctx context.Context, start string) iter.Seq2[string, error]
- func (s KV) Put(ctx context.Context, opts blob.PutOptions) error
- type Options
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KV ¶
type KV struct {
// contains filtered or unexported fields
}
A KV implements the blob.KV interface on an S3 bucket. Since S3 does not support empty keys, access to an empty key will report blob.ErrKeyNotFound as required by the interface.
type Options ¶
type Options struct { // If set, this prefix is prepended to all keys sent to S3. // A trailing slash ("/") is appended if one is not already present. KeyPrefix string // If set, us these rate limits apply to requests to the store. ReadQPS int WriteQPS int // Optional AWS config loader options. AWSConfigOptions []func(*config.LoadOptions) error }
Options are optional settings for a KV. A nil *Options is ready for use and provides zero values for all fields.
type Store ¶
Store implements the blob.StoreCloser interface over an S3 bucket.
func New ¶
New creates a new Store that references the given bucket and region. If opts == nil, default options are provided as described on Options.
By default, New constructs an AWS session using ambient credentials from the environment or from a configuration file profile. To specify credentials from another source, set the [Options.AWSConfigOptions] field.