Documentation ¶
Overview ¶
Package s3store implements the blob.Store interface on Amazon S3.
Index ¶
- func Opener(_ context.Context, addr string) (blob.Store, error)
- type Options
- type Store
- func (*Store) Close(_ context.Context) error
- func (s *Store) Delete(ctx context.Context, key string) error
- func (s *Store) Get(ctx context.Context, key string) ([]byte, error)
- func (s *Store) Len(ctx context.Context) (int64, error)
- func (s *Store) List(ctx context.Context, start string, f func(string) error) error
- func (s *Store) Put(ctx context.Context, opts blob.PutOptions) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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 // An optional AWS configuration to use when constructing the session. AWSConfig *aws.Config }
Options are optional settings for a Store. A nil *Options is ready for use and provides zero values for all fields.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
A Store implements the blob.Store 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.
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 AWSConfig field of the options.