stateenvirons

package
v0.0.0-...-8ff1004 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package stateenvirons provides types and functions that interface the state and environs packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloudSpec

func CloudSpec(
	accessor state.CloudAccessor,
	cloudName, regionName string,
	credentialTag names.CloudCredentialTag,
) (environs.CloudSpec, error)

CloudSpec returns an environs.CloudSpec from a *state.State, given the cloud, region and credential names.

func GetNewPolicyFunc

func GetNewPolicyFunc() state.NewPolicyFunc

GetNewPolicyFunc returns a state.NewPolicyFunc that will return a state.Policy implemented in terms of either environs.Environ or caas.Broker and related types.

func NewStorageProviderRegistry

func NewStorageProviderRegistry(reg storage.ProviderRegistry) storage.ProviderRegistry

NewStorageProviderRegistry returns a storage.ProviderRegistry that chains the provided registry with the common storage providers.

func NewStorageProviderRegistryForModel

func NewStorageProviderRegistryForModel(
	model *state.Model,
	newEnv NewEnvironFunc,
	newBroker NewCAASBrokerFunc,
) (_ storage.ProviderRegistry, err error)

NewStorageProviderRegistryForModel returns a storage provider registry for the specified model.

Types

type EnvironConfigGetter

type EnvironConfigGetter struct {
	*state.State
	*state.Model
}

EnvironConfigGetter implements environs.EnvironConfigGetter in terms of a *state.State. TODO - CAAS(externalreality): Once cloud methods are migrated to model EnvironConfigGetter will no longer need to contain both state and model but only model.

func (EnvironConfigGetter) CloudSpec

func (g EnvironConfigGetter) CloudSpec() (environs.CloudSpec, error)

CloudSpec implements environs.EnvironConfigGetter.

type NewCAASBrokerFunc

type NewCAASBrokerFunc func(*state.State) (caas.Broker, error)

NewCAASBrokerFunc defines the type of a function that, given a state.State, returns a new CAAS broker.

func GetNewCAASBrokerFunc

func GetNewCAASBrokerFunc(newBroker caas.NewContainerBrokerFunc) NewCAASBrokerFunc

GetNewCAASBrokerFunc returns a NewCAASBrokerFunc, that constructs CAAS brokers using the given caas.NewContainerBrokerFunc.

type NewEnvironFunc

type NewEnvironFunc func(*state.State) (environs.Environ, error)

NewEnvironFunc defines the type of a function that, given a state.State, returns a new Environ.

func GetNewEnvironFunc

func GetNewEnvironFunc(newEnviron environs.NewEnvironFunc) NewEnvironFunc

GetNewEnvironFunc returns a NewEnvironFunc, that constructs Environs using the given environs.NewEnvironFunc.

Jump to

Keyboard shortcuts

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