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

package stateenvirons

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

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

Index

Package Files

config.go doc.go policy.go

func CloudSpec Uses

func CloudSpec(
    modelCloud cloud.Cloud,
    regionName string,
    credential *state.Credential,
) (environscloudspec.CloudSpec, error)

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

func CloudSpecForModel Uses

func CloudSpecForModel(m baseModel) (environscloudspec.CloudSpec, error)

CloudSpecForModel returns a CloudSpec for the specified model.

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 {
    Model

    // 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 Model.

func (EnvironConfigGetter) CloudAPIVersion Uses

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

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

func (EnvironConfigGetter) CloudSpec Uses

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

CloudSpec implements environs.EnvironConfigGetter.

func (EnvironConfigGetter) ModelConfig Uses

func (g EnvironConfigGetter) ModelConfig() (*config.Config, error)

ModelConfig implements environs.EnvironConfigGetter.

type Model Uses

type Model interface {
    ModelTag() names.ModelTag
    ControllerUUID() string
    Type() state.ModelType
    Config() (*config.Config, error)
    // contains filtered or unexported methods
}

Model exposes the methods needed for an EnvironConfigGetter.

type NewCAASBrokerFunc Uses

type NewCAASBrokerFunc func(Model) (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(Model) (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 12 packages (graph). Updated 2020-08-06. Refresh now. Tools for package owners.