s3

package
v1.219.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStore

func NewStore(opts artifact.StoreOptions) (artifact.Backend, error)

NewStore creates a new S3 backend. If opts.Identity is empty, the AWS client is initialized eagerly using the default credential chain. If non-empty, initialization is deferred until first use so the artifact registry can inject an AuthContextResolver.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements the artifact.Backend interface using AWS S3.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, key string) error

Delete deletes an artifact from S3.

func (*Store) Download

func (s *Store) Download(ctx context.Context, key string) (io.ReadCloser, *artifact.Metadata, error)

Download downloads a single data stream from S3. Returns an io.ReadCloser for the data and the metadata sidecar.

func (*Store) Exists

func (s *Store) Exists(ctx context.Context, key string) (bool, error)

Exists checks if an artifact exists.

func (*Store) GetMetadata

func (s *Store) GetMetadata(ctx context.Context, key string) (*artifact.Metadata, error)

GetMetadata retrieves metadata for an artifact without downloading the content.

func (*Store) List

func (s *Store) List(ctx context.Context, query artifact.Query) ([]artifact.ArtifactInfo, error)

List lists artifacts matching the given query.

func (*Store) Name

func (s *Store) Name() string

Name returns the store type name.

func (*Store) SetAuthContext added in v1.218.0

func (s *Store) SetAuthContext(resolver artifact.AuthContextResolver, identityName string)

SetAuthContext implements artifact.IdentityAwareBackend. A non-empty identityName overrides the identity supplied at construction.

Must be called before the first Store operation. SetAuthContext writes authResolver and identityName without synchronization; ensureClient reads them inside initOnce.Do, so calling SetAuthContext concurrently with (or after) operations that may trigger ensureClient is unsafe. The artifact registry honors this contract by calling SetAuthContext synchronously before returning the backend.

func (*Store) Upload

func (s *Store) Upload(ctx context.Context, key string, data io.Reader, size int64, metadata *artifact.Metadata) error

Upload uploads a single data stream to S3 with a metadata sidecar.

Jump to

Keyboard shortcuts

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