storage

package
v0.0.0-...-f88c608 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: AGPL-3.0 Imports: 6 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// InvalidStorageName represents an invalid storage name.
	InvalidStorageName = errors.ConstError("invalid storage name")
	// InvalidStorageID represents an invalid storage id.
	InvalidStorageID = errors.ConstError("invalid storage id")
)
View Source
const (
	// ErrStorageRegistryDying is used to indicate to *third parties* that the
	// storage registry worker is dying, instead of catacomb.ErrDying, which is
	// unsuitable for propagating inter-worker.
	// This error indicates to consuming workers that their dependency has
	// become unmet and a restart by the dependency engine is imminent.
	ErrStorageRegistryDying = errors.ConstError("storage registry worker is dying")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstModelStorageRegistry

type ConstModelStorageRegistry func() storage.ProviderRegistry

ConstModelStorageRegistry is a function that returns the same storage registry every time it is called.

func (ConstModelStorageRegistry) GetStorageRegistry

GetStorageRegistry returns a storage registry for the given namespace.

type ID

type ID string

ID represents a storage ID which is a name with a sequence number.

func ParseID

func ParseID(id string) (ID, error)

ParseID returns a new ID. If the id is invalid, an InvalidStorageID error will be returned.

func (ID) String

func (id ID) String() string

String returns the ID as a string.

func (ID) Validate

func (id ID) Validate() error

Validate returns an error if the ID is invalid. The returned error is an InvalidStorageID error.

type ModelStorageRegistryGetter

type ModelStorageRegistryGetter interface {
	// GetStorageRegistry returns a storage registry for the given namespace.
	GetStorageRegistry(context.Context) (storage.ProviderRegistry, error)
}

ModelStorageRegistryGetter is the interface that is used to get a storage registry.

type Name

type Name string

Name represents a storage name.

func ParseName

func ParseName(name string) (Name, error)

ParseName returns a new Name. If the name is invalid, an InvalidStorageName error will be returned.

func (Name) String

func (n Name) String() string

String returns the Name as a string.

func (Name) Validate

func (n Name) Validate() error

Validate returns an error if the Name is invalid. The returned error is an InvalidStorageName error.

type StorageRegistryGetter

type StorageRegistryGetter interface {
	// GetStorageRegistry returns a storage registry for the given namespace.
	GetStorageRegistry(context.Context, string) (storage.ProviderRegistry, error)
}

StorageRegistryGetter is the interface that is used to get a storage registry.

type UUID

type UUID string

UUID represents a storage unique identifier.

func NewUUID

func NewUUID() (UUID, error)

NewUUID is a convenience function for generating a new storage uuid.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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