poolmanager

package
v0.0.0-...-a002913 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2015 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Pool configuration attribute names.
	Name = "name"
	Type = "type"
)

Variables

View Source
var (
	MissingTypeError = errors.New("provider type is missing")
	MissingNameError = errors.New("pool name is missing")
)

Functions

func AddDefaultStoragePools

func AddDefaultStoragePools(settings SettingsManager) error

AddDefaultStoragePools is run at bootstrap and on upgrade to ensure that out of the box storage pools are created.

func RegisterDefaultStoragePools

func RegisterDefaultStoragePools(pools []*storage.Config)

RegisterDefaultStoragePools registers pool information to be saved to state when AddDefaultStoragePools is called.

Types

type PoolManager

type PoolManager interface {
	// Create makes a new pool with the specified configuration and persists it to state.
	Create(name string, providerType storage.ProviderType, attrs map[string]interface{}) (*storage.Config, error)

	// Delete removes the pool with name from state.
	Delete(name string) error

	// Get returns the pool with name from state.
	Get(name string) (*storage.Config, error)

	// List returns all the pools from state.
	List() ([]*storage.Config, error)
}

A PoolManager provides access to storage pools.

func New

func New(settings SettingsManager) PoolManager

New returns a PoolManager implementation using the specified state.

type SettingsManager

type SettingsManager interface {
	CreateSettings(key string, settings map[string]interface{}) error
	ReadSettings(key string) (map[string]interface{}, error)
	RemoveSettings(key string) error
	ListSettings(keyPrefix string) (map[string]map[string]interface{}, error)
}

Jump to

Keyboard shortcuts

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