juju: github.com/juju/juju/state/stateenvirons Index | Files

package stateenvirons

import "github.com/juju/juju/state/stateenvirons"

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


Package Files

config.go doc.go policy.go

func CloudSpec Uses

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 Uses

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 Uses

func NewStorageProviderRegistry(reg storage.ProviderRegistry) storage.ProviderRegistry

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

func NewStorageProviderRegistryForModel Uses

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

NewStorageProviderRegistryForModel returns a storage provider registry for the specified model.

type EnvironConfigGetter Uses

type EnvironConfigGetter struct {

    // NewContainerBroker is a func that returns a caas container broker
    // for the relevant model.
    NewContainerBroker caas.NewContainerBrokerFunc

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) CloudAPIVersion Uses

func (g EnvironConfigGetter) CloudAPIVersion(spec environs.CloudSpec) (string, error)

CloudAPIVersion returns the cloud API version for the cloud with the given spec.

func (EnvironConfigGetter) CloudSpec Uses

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

CloudSpec implements environs.EnvironConfigGetter.

type NewCAASBrokerFunc Uses

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 Uses

func GetNewCAASBrokerFunc(newBroker caas.NewContainerBrokerFunc) NewCAASBrokerFunc

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

type NewEnvironFunc Uses

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 Uses

func GetNewEnvironFunc(newEnviron environs.NewEnvironFunc) NewEnvironFunc

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

Package stateenvirons imports 11 packages (graph) and is imported by 350 packages. Updated 2019-08-26. Refresh now. Tools for package owners.