storage

package
v0.1.1-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMetadataNotExist should be returned by ReadMetadata() when no metadata is found.
	// Callers should check for this error, since in certain conditions no metadata is desired.
	ErrMetadataNotExist = errors.New("metadata does not exist")
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	ReadMetadata(context.Context, *v1alpha1.Metadata, string) error
	WriteMetadata(context.Context, *v1alpha1.Metadata, string) error
	ReadObject(context.Context, string, interface{}) error
	WriteObject(context.Context, string, interface{}) error
	GetWriter(context.Context, string) (io.Writer, error)
	CheckConfig(v1alpha1.StorageConfig) error
}

func ByConfig

func ByConfig(ctx context.Context, dir string, storage v1alpha1.StorageConfig) (Backend, error)

ByConfig returns backend interface based on provided config

func NewLocalBackend

func NewLocalBackend(dir string) (Backend, error)

func NewRegistryBackend

func NewRegistryBackend(ctx context.Context, cfg *v1alpha1.RegistryConfig, dir string) (Backend, error)

type Committer

type Committer interface {
	// Commit the set of writes to the Backend for persistence.
	// Commit is NOT guaranteed to be threadsafe, see implementer comments for details.
	Commit(context.Context) error
}

Committer is a Backend that collects a set of write operations into a transaction then commits them atomically. The technologies underlying these Backends are typically transactional by nature (like git); this interface exposes that nature.

Jump to

Keyboard shortcuts

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