Documentation
¶
Index ¶
- Constants
- Variables
- func DetectedMediaType(b []byte) types.MediaType
- func IsNotFound(err error) bool
- func IsUploadSizeExceeded(err error) bool
- type Describer
- type Downloader
- type ErrNotFound
- type ErrUploadSizeExceeded
- type Provider
- type Providers
- type StreamingUploader
- type Uploader
- type UploaderDownloader
Constants ¶
const ( AuthorAnnotation = "chainloop.dev" // Default prefix for the blobmanager DefaultPrefix = "chainloop" )
Variables ¶
var ErrValidation = errors.New("credentials validation error")
Functions ¶
func DetectedMediaType ¶
Detect the media type based on the provided content
func IsNotFound ¶
func IsUploadSizeExceeded ¶ added in v1.79.0
Types ¶
type Downloader ¶
type ErrNotFound ¶
type ErrNotFound struct {
// contains filtered or unexported fields
}
func NewErrNotFound ¶
func NewErrNotFound(entity string) ErrNotFound
func (ErrNotFound) Error ¶
func (e ErrNotFound) Error() string
type ErrUploadSizeExceeded ¶ added in v1.79.0
type ErrUploadSizeExceeded struct {
// contains filtered or unexported fields
}
func NewErrUploadSizeExceeded ¶ added in v1.79.0
func NewErrUploadSizeExceeded(want, maxSize int64) ErrUploadSizeExceeded
func (ErrUploadSizeExceeded) Error ¶ added in v1.79.0
func (e ErrUploadSizeExceeded) Error() string
type Provider ¶
type Provider interface {
// Provider identifier
ID() string
// retrieve a downloader/uploader from a secret
FromCredentials(ctx context.Context, secretName string) (UploaderDownloader, error)
// validate and extract credentials from raw json
ValidateAndExtractCredentials(location string, credsJSON []byte) (any, error)
}
Provider is an interface that allows to create a backend from a secret
type StreamingUploader ¶ added in v1.106.0
type StreamingUploader interface {
// SupportsStreaming reports whether Upload can be fed a streaming reader
// without the caller buffering the full artifact in memory first.
SupportsStreaming() bool
}
StreamingUploader is an optional interface implemented by backends whose Upload can consume the artifact directly from a streaming io.Reader without requiring the whole blob to be buffered in memory first.
The Artifact CAS service type-asserts uploaders against this interface: when a backend reports SupportsStreaming()==true the upload is piped straight from the client stream to the backend, bounding CAS memory usage independently of artifact size (PFM-6923). Backends that do not implement it (e.g. the OCI backend, whose push path needs the full layer content up front) keep the buffered code path.
type UploaderDownloader ¶
type UploaderDownloader interface {
Uploader
Downloader
Describer
}