Documentation
¶
Overview ¶
Package s3store is the objectstore.ObjectStore and objectstore.Lister on the S3 client of a named connection of the connection factory: GetObject for reads, ListObjectsV2 for listings and HeadObject for the description of one key.
Index ¶
- Variables
- type S3Provider
- type Store
- func (*Store) CanHead() bool
- func (s *Store) Get(ctx context.Context, req objectstore.GetRequest) (objectstore.Object, error)
- func (s *Store) Head(ctx context.Context, key string) (objectstore.ListEntry, error)
- func (s *Store) List(ctx context.Context, req objectstore.ListRequest) (objectstore.ListPage, error)
Constants ¶
This section is empty.
Variables ¶
var ErrListLoop = errors.New("objectstore: the listing repeats a continuation token")
ErrListLoop is the cause of a listing whose continuation token repeats.
Functions ¶
This section is empty.
Types ¶
type S3Provider ¶
S3Provider gives the S3 client of a named connection. The connection factory (internal/connection) implements it. The store asks on every call, so a client the factory replaced after a reload is picked up and there is never a second client for the connection.
type Store ¶
type Store struct {
objectstore.NoLifecycle
// contains filtered or unexported fields
}
Store is an objectstore.ObjectStore on the S3 client of a connection. It issues GetObject for reads, ListObjectsV2 for listings and HeadObject for the description of one key.
func New ¶
func New(provider S3Provider, connectionName, bucket string) *Store
New returns the store of bucket on the connection named connectionName. Keys are absolute bucket keys, as the publisher writes them (a key prefix is applied by the publisher only): the store fetches exactly the key it is given and never adds a prefix.
func (*Store) CanHead ¶
CanHead implements objectstore.Lister: S3 has HeadObject.
func (*Store) Get ¶
func (s *Store) Get(ctx context.Context, req objectstore.GetRequest) (objectstore.Object, error)
Get implements objectstore.ObjectStore with GetObject, IfNoneMatch and VersionId. The body is read into one buffer sized from the Content-Length (or from the limit when the answer has none), never beyond the limit.
func (*Store) Head ¶
Head implements objectstore.Lister with one HeadObject request: the entry has the marker, size and modification time that ListObjectsV2 gives for the same object.
func (*Store) List ¶
func (s *Store) List(ctx context.Context, req objectstore.ListRequest) (objectstore.ListPage, error)
List implements objectstore.Lister with one ListObjectsV2 request on the bucket of the store: the page has up to Limit keys (at most 1000) and its token is the continuation token of S3. The marker of an entry is its ETag and size together.