s3

package
v1.235.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2026 License: Apache-2.0 Imports: 17 Imported by: 1 module, 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

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.

It is a CI adapter over the shared transport in pkg/artifact/blob/s3: this type owns the legacy key pattern (prefix joined with path.Join), the ".metadata.json" sidecar, and the legacy error sentinels, while client construction and object I/O live in the transport. Unlike the generic transport, it keeps the historical fallback to the default credential chain when an identity is configured but no resolver was injected.

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