pool

package
v0.0.0-...-f19ae85 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2015 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

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

Variables

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

Functions

func RegisterDefaultPools

func RegisterDefaultPools(pm PoolManager, agentConfig agent.Config) error

RegisterDefaultPools ensures that the required out of the box storage pools are registered.

func RegisterPool

func RegisterPool(pm PoolManager, name string, providerType storage.ProviderType, replace bool, cfg map[string]interface{}) error

RegisterPool creates a named pool for the provider type with the specified config.

Types

type Pool

type Pool interface {
	// Name is the pool's name.
	Name() string

	// Type is the type of storage provider this pool represents, eg "loop", "ebs.
	Type() storage.ProviderType

	// Config is the pool's configuration attributes.
	Config() map[string]interface{}
}

A Pool is a storage provider with configuration.

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{}) (Pool, error)

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

	// Get returns the pool with name from state.
	Get(name string) (Pool, error)

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

A PoolManager provides access to storage pools.

func NewPoolManager

func NewPoolManager(settings SettingsManager) PoolManager

NewPoolManager returns a NewPoolManager 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