Documentation
¶
Index ¶
- func NewStore(opts artifact.StoreOptions) (artifact.Backend, error)
- type Store
- func (s *Store) Delete(ctx context.Context, key string) error
- func (s *Store) Download(ctx context.Context, key string) (io.ReadCloser, *artifact.Metadata, error)
- func (s *Store) Exists(ctx context.Context, key string) (bool, error)
- func (s *Store) GetMetadata(ctx context.Context, key string) (*artifact.Metadata, error)
- func (s *Store) List(ctx context.Context, query artifact.Query) ([]artifact.ArtifactInfo, error)
- func (s *Store) Name() string
- func (s *Store) SetAuthContext(resolver artifact.AuthContextResolver, identityName string)
- func (s *Store) Upload(ctx context.Context, key string, data io.Reader, size int64, ...) error
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) 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) GetMetadata ¶
GetMetadata retrieves metadata for an artifact without downloading the content.
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.