juju: github.com/juju/juju/storage/poolmanager Index | Files

package poolmanager

import "github.com/juju/juju/storage/poolmanager"

Index

Package Files

defaultpool.go interface.go poolmanager.go

Constants

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

Variables

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

func AddDefaultStoragePools Uses

func AddDefaultStoragePools(p storage.Provider, pm PoolManager) error

AddDefaultStoragePools adds the default storage pools for the given provider to the given pool manager. This is called whenever a new model is created.

type MemSettings Uses

type MemSettings struct {
    Settings map[string]map[string]interface{}
}

MemSettings is an in-memory implementation of SettingsManager. This type does not provide any goroutine-safety.

func (MemSettings) CreateSettings Uses

func (m MemSettings) CreateSettings(key string, settings map[string]interface{}) error

CreateSettings is part of the SettingsManager interface.

func (MemSettings) ListSettings Uses

func (m MemSettings) ListSettings(keyPrefix string) (map[string]map[string]interface{}, error)

ListSettings is part of the SettingsManager interface.

func (MemSettings) ReadSettings Uses

func (m MemSettings) ReadSettings(key string) (map[string]interface{}, error)

ReadSettings is part of the SettingsManager interface.

func (MemSettings) RemoveSettings Uses

func (m MemSettings) RemoveSettings(key string) error

RemoveSettings is part of the SettingsManager interface.

func (MemSettings) ReplaceSettings Uses

func (m MemSettings) ReplaceSettings(key string, settings map[string]interface{}) error

ReplaceSettings is part of the SettingsManager interface.

type PoolManager Uses

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

    // Replace replaces pool configuration with the newly provided values.
    Replace(name, provider string, attrs map[string]interface{}) 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 Uses

func New(settings SettingsManager, registry storage.ProviderRegistry) PoolManager

New returns a PoolManager implementation using the specified state.

type SettingsManager Uses

type SettingsManager interface {
    CreateSettings(key string, settings map[string]interface{}) error
    ReplaceSettings(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)
}

Package poolmanager imports 4 packages (graph) and is imported by 220 packages. Updated 2019-03-18. Refresh now. Tools for package owners.