Documentation
¶
Index ¶
- func CreateStoragePools(ctx context.Context, db domain.TxnRunner, ...) error
- func GetStoragePoolByName(ctx context.Context, db domain.TxnRunner, name string) (domainstorage.StoragePoolDetails, error)
- type State
- func (st State) CreateStoragePool(ctx context.Context, pool domainstorage.StoragePoolDetails) error
- func (st State) DeleteStoragePool(ctx context.Context, name string) error
- func (s State) GetModelDetails() (domainstorage.ModelDetails, error)
- func (st State) GetStoragePoolByName(ctx context.Context, name string) (domainstorage.StoragePoolDetails, error)
- func (s State) ImportFilesystem(ctx context.Context, name storage.Name, ...) (storage.ID, error)
- func (st State) ListStoragePools(ctx context.Context, names domainstorage.Names, ...) ([]domainstorage.StoragePoolDetails, error)
- func (st State) ReplaceStoragePool(ctx context.Context, pool domainstorage.StoragePoolDetails) error
- type StoragePool
- type StoragePoolNames
- type StoragePools
- type StorageProviderTypes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateStoragePools ¶
func CreateStoragePools(ctx context.Context, db domain.TxnRunner, pools []domainstorage.StoragePoolDetails) error
CreateStoragePools creates the specified storage pools. It is exported for us in the storage/bootstrap package.
func GetStoragePoolByName ¶
func GetStoragePoolByName(ctx context.Context, db domain.TxnRunner, name string) (domainstorage.StoragePoolDetails, error)
GetStoragePoolByName returns the storage pool with the specified name, returning an error satisfying storageerrors.PoolNotFoundError if it doesn't exist. Exported for use by other domains that need to load storage pools.
Types ¶
type State ¶
State represents database interactions dealing with storage.
func NewState ¶
func NewState(factory coredatabase.TxnRunnerFactory) *State
NewState returns a new storage state based on the input database factory method.
func (State) CreateStoragePool ¶
func (st State) CreateStoragePool(ctx context.Context, pool domainstorage.StoragePoolDetails) error
CreateStoragePool creates a storage pool, returning an error satisfying storageerrors.PoolAlreadyExists if a pool with the same name already exists.
func (State) DeleteStoragePool ¶
DeleteStoragePool deletes a storage pool, returning an error satisfying errors.NotFound if it doesn't exist.
func (State) GetModelDetails ¶
func (s State) GetModelDetails() (domainstorage.ModelDetails, error)
func (State) GetStoragePoolByName ¶
func (st State) GetStoragePoolByName(ctx context.Context, name string) (domainstorage.StoragePoolDetails, error)
GetStoragePoolByName returns the storage pool with the specified name, returning an error satisfying storageerrors.PoolNotFoundError if it doesn't exist.
func (State) ImportFilesystem ¶
func (s State) ImportFilesystem(ctx context.Context, name storage.Name, filesystem domainstorage.FilesystemInfo) (storage.ID, error)
func (State) ListStoragePools ¶
func (st State) ListStoragePools(ctx context.Context, names domainstorage.Names, providers domainstorage.Providers) ([]domainstorage.StoragePoolDetails, error)
ListStoragePools returns the storage pools matching the specified filter.
func (State) ReplaceStoragePool ¶
func (st State) ReplaceStoragePool(ctx context.Context, pool domainstorage.StoragePoolDetails) error
ReplaceStoragePool replaces an existing storage pool, returning an error satisfying errors.NotFound if a pool with the name does not exist.
type StoragePool ¶
type StoragePoolNames ¶
type StoragePoolNames []string
type StoragePools ¶
type StoragePools []StoragePool
type StorageProviderTypes ¶
type StorageProviderTypes []string