Help us shape the future of Go! Take the 2026 Go Developer Survey

backend

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthorAnnotation = "chainloop.dev"
	// Default prefix for the blobmanager
	DefaultPrefix = "chainloop"
)

Variables

View Source
var ErrValidation = errors.New("credentials validation error")

Functions

func DetectedMediaType added in v0.19.0

func DetectedMediaType(b []byte) types.MediaType

Detect the media type based on the provided content

func IsNotFound added in v0.13.0

func IsNotFound(err error) bool

Types

type Describer

type Describer interface {
	Describe(ctx context.Context, digest string) (*v1.CASResource, error)
}

type Downloader

type Downloader interface {
	Download(ctx context.Context, w io.Writer, digest string) error
}

type ErrNotFound added in v0.13.0

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

func NewErrNotFound added in v0.13.0

func NewErrNotFound(entity string) ErrNotFound

func (ErrNotFound) Error added in v0.13.0

func (e ErrNotFound) 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 Providers added in v0.14.0

type Providers map[string]Provider

type Uploader

type Uploader interface {
	Upload(ctx context.Context, r io.Reader, resource *v1.CASResource) error
	Exists(ctx context.Context, digest string) (bool, error)
	CheckWritePermissions(ctx context.Context) error
}

type UploaderDownloader

type UploaderDownloader interface {
	Uploader
	Downloader
	Describer
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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