Documentation ¶
Overview ¶
Package stateenvirons provides types and functions that interface the state and environs packages.
Index ¶
- func CloudSpec(accessor state.CloudAccessor, cloudName, regionName string, ...) (environs.CloudSpec, error)
- func GetNewPolicyFunc() state.NewPolicyFunc
- func NewStorageProviderRegistry(reg storage.ProviderRegistry) storage.ProviderRegistry
- func NewStorageProviderRegistryForModel(model *state.Model, newEnv NewEnvironFunc, newBroker NewCAASBrokerFunc) (_ storage.ProviderRegistry, err error)
- type EnvironConfigGetter
- type NewCAASBrokerFunc
- type NewEnvironFunc
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 ¶
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.
type NewCAASBrokerFunc ¶
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 ¶
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.