s3store

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

View Source
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

type S3Provider interface {
	S3(ctx context.Context, name string) (*s3.Client, error)
}

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

func (*Store) CanHead() bool

CanHead implements objectstore.Lister: S3 has HeadObject.

func (*Store) Get

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

func (s *Store) Head(ctx context.Context, key string) (objectstore.ListEntry, error)

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL