Documentation
¶
Index ¶
Constants ¶
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") )
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 ¶
func (c ConstModelStorageRegistry) GetStorageRegistry(ctx context.Context) (storage.ProviderRegistry, error)
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 ¶
ParseID returns a new ID. If the id is invalid, an InvalidStorageID error will be returned.
func (ID) Validate ¶
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 ¶
ParseName returns a new Name. If the name is invalid, an InvalidStorageName error will be returned.
func (Name) Validate ¶
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.