juju: github.com/juju/juju/environs/config Index | Files

package config

import "github.com/juju/juju/environs/config"

Index

Package Files

authkeys.go config.go source.go validator.go

Constants

const (
    // FwInstance requests the use of an individual firewall per instance.
    FwInstance = "instance"

    // FwGlobal requests the use of a single firewall group for all machines.
    // When ports are opened for one machine, all machines will have the same
    // port opened.
    FwGlobal = "global"

    // FwNone requests that no firewalling should be performed inside
    // the environment. No firewaller worker will be started. It's
    // useful for clouds without support for either global or per
    // instance security groups.
    FwNone = "none"
)
const (

    // NameKey is the key for the model's name.
    NameKey = "name"

    // TypeKey is the key for the model's cloud type.
    TypeKey = "type"

    // AgentVersionKey is the key for the model's Juju agent version.
    AgentVersionKey = "agent-version"

    // UUIDKey is the key for the model UUID attribute.
    UUIDKey = "uuid"

    // AuthorizedKeysKey is the key for the authorized-keys attribute.
    AuthorizedKeysKey = "authorized-keys"

    // ProvisionerHarvestModeKey stores the key for this setting.
    ProvisionerHarvestModeKey = "provisioner-harvest-mode"

    // AgentStreamKey stores the key for this setting.
    AgentStreamKey = "agent-stream"

    // AgentMetadataURLKey stores the key for this setting.
    AgentMetadataURLKey = "agent-metadata-url"

    // ContainerImageStreamKey is the key used to specify the stream
    // to for container OS images.
    ContainerImageStreamKey = "container-image-stream"

    // ContainerImageMetadataURLKey is the key used to specify the location
    // of OS image metadata for containers.
    ContainerImageMetadataURLKey = "container-image-metadata-url"

    // HTTPProxyKey stores the key for this setting.
    HTTPProxyKey = "http-proxy"

    // HTTPSProxyKey stores the key for this setting.
    HTTPSProxyKey = "https-proxy"

    // FTPProxyKey stores the key for this setting.
    FTPProxyKey = "ftp-proxy"

    // NoProxyKey stores the key for this setting.
    NoProxyKey = "no-proxy"

    // JujuHTTPProxyKey stores the key for this setting.
    JujuHTTPProxyKey = "juju-http-proxy"

    // JujuHTTPSProxyKey stores the key for this setting.
    JujuHTTPSProxyKey = "juju-https-proxy"

    // JujuFTPProxyKey stores the key for this setting.
    JujuFTPProxyKey = "juju-ftp-proxy"

    // JujuNoProxyKey stores the key for this setting.
    JujuNoProxyKey = "juju-no-proxy"

    // AptHTTPProxyKey stores the key for this setting.
    AptHTTPProxyKey = "apt-http-proxy"

    // AptHTTPSProxyKey stores the key for this setting.
    AptHTTPSProxyKey = "apt-https-proxy"

    // AptFTPProxyKey stores the key for this setting.
    AptFTPProxyKey = "apt-ftp-proxy"

    // AptNoProxyKey stores the key for this setting.
    AptNoProxyKey = "apt-no-proxy"

    // SnapHTTPProxyKey is used to set the snap core setting proxy.http for deployed machines.
    SnapHTTPProxyKey = "snap-http-proxy"
    // SnapHTTPSProxyKey is used to set the snap core setting proxy.https for deployed machines.
    SnapHTTPSProxyKey = "snap-https-proxy"
    // SnapStoreProxyKey is used to set the snap core setting proxy.store for deployed machines.
    SnapStoreProxyKey = "snap-store-proxy"
    // SnapStoreAssertionsKey is used to configure the deployed machines to acknowledge the
    // store proxy assertions.
    SnapStoreAssertionsKey = "snap-store-assertions"

    // NetBondReconfigureDelay is the key to pass when bridging
    // the network for containers.
    NetBondReconfigureDelayKey = "net-bond-reconfigure-delay"

    // ContainerNetworkingMethod is the key for setting up
    // networking method for containers.
    ContainerNetworkingMethod = "container-networking-method"

    // The default block storage source.
    StorageDefaultBlockSourceKey = "storage-default-block-source"

    // The default filesystem storage source.
    StorageDefaultFilesystemSourceKey = "storage-default-filesystem-source"

    // ResourceTagsKey is an optional list or space-separated string
    // of k=v pairs, defining the tags for ResourceTags.
    ResourceTagsKey = "resource-tags"

    // LogForwardEnabled determines whether the log forward functionality is enabled.
    LogForwardEnabled = "logforward-enabled"

    // LogFwdSyslogHost sets the hostname:port of the syslog server.
    LogFwdSyslogHost = "syslog-host"

    // LogFwdSyslogCACert sets the certificate of the CA that signed the syslog
    // server certificate.
    LogFwdSyslogCACert = "syslog-ca-cert"

    // LogFwdSyslogClientCert sets the client certificate for syslog
    // forwarding.
    LogFwdSyslogClientCert = "syslog-client-cert"

    // LogFwdSyslogClientKey sets the client key for syslog
    // forwarding.
    LogFwdSyslogClientKey = "syslog-client-key"

    // AutomaticallyRetryHooks determines whether the uniter will
    // automatically retry a hook that has failed
    AutomaticallyRetryHooks = "automatically-retry-hooks"

    // TransmitVendorMetricsKey is the key for whether the controller sends
    // metrics collected in this model for anonymized aggregate analytics.
    TransmitVendorMetricsKey = "transmit-vendor-metrics"

    // ExtraInfoKey is the key for arbitrary user specified string data that
    // is stored against the model.
    ExtraInfoKey = "extra-info"

    // MaxStatusHistoryAge is the maximum age of status history values
    // to keep when pruning, eg "72h"
    MaxStatusHistoryAge = "max-status-history-age"

    // MaxStatusHistorySize is the maximum size the status history
    // collection can grow to before it is pruned, eg "5M"
    MaxStatusHistorySize = "max-status-history-size"

    // MaxActionResultsAge is the maximum age of actions to keep when pruning, eg
    // "72h"
    MaxActionResultsAge = "max-action-results-age"

    // MaxActionResultsSize is the maximum size the actions collection can
    // grow to before it is pruned, eg "5M"
    MaxActionResultsSize = "max-action-results-size"

    // UpdateStatusHookInterval is how often to run the update-status hook.
    UpdateStatusHookInterval = "update-status-hook-interval"

    // EgressSubnets are the source addresses from which traffic from this model
    // originates if the model is deployed such that NAT or similar is in use.
    EgressSubnets = "egress-subnets"

    // FanConfig defines the configuration for FAN network running in the model.
    FanConfig = "fan-config"

    // CloudInitUserDataKey is the key to specify cloud-init yaml the user
    // wants to add into the cloud-config data produced by Juju when
    // provisioning machines.
    CloudInitUserDataKey = "cloudinit-userdata"

    // BackupDirKey specifies the backup working directory.
    BackupDirKey = "backup-dir"

    // ContainerInheritPropertiesKey is the key to specify a list of properties
    // to be copied from a machine to a container during provisioning. The
    // list will be comma separated.
    ContainerInheritPropertiesKey = "container-inherit-properties"

    // IgnoreMachineAddresses, when true, will cause the
    // machine worker not to discover any machine addresses
    // on start up.
    IgnoreMachineAddresses = "ignore-machine-addresses"
)

TODO(katco-): Please grow this over time. Centralized place to store values of config keys. This transitions mistakes in referencing key-values to a compile-time error.

const (
    // DefaultStatusHistoryAge is the default value for MaxStatusHistoryAge.
    DefaultStatusHistoryAge = "336h" // 2 weeks

    // DefaultStatusHistorySize is the default value for MaxStatusHistorySize.
    DefaultStatusHistorySize = "5G"

    // DefaultUpdateStatusHookInterval is the default value for UpdateStatusHookInterval
    DefaultUpdateStatusHookInterval = "5m"

    DefaultActionResultsAge = "336h" // 2 weeks

    DefaultActionResultsSize = "5G"
)
const (
    // JujuDefaultSource is used to label model config attributes that
    // come from hard coded defaults.
    JujuDefaultSource = "default"

    // JujuControllerSource is used to label model config attributes that
    // come from those associated with the controller.
    JujuControllerSource = "controller"

    // JujuRegionSource is used to label model config attributes that come from
    // those associated with the region where the model is
    // running.
    JujuRegionSource = "region"

    // JujuModelConfigSource is used to label model config attributes that
    // have been explicitly set by the user.
    JujuModelConfigSource = "model"
)

These constants define named sources of model config attributes. After a call to UpdateModelConfig, any attributes added/removed will have a source of JujuModelConfigSource.

const (
    // JujuSystemKey is the SSH key comment for Juju system keys.
    JujuSystemKey = "juju-system-key"
)

func AptProxyConfigMap Uses

func AptProxyConfigMap(proxySettings proxy.Settings) map[string]interface{}

AptProxyConfigMap returns a map suitable to be applied to a Config to update proxy settings.

func CoerceForStorage Uses

func CoerceForStorage(attrs map[string]interface{}) map[string]interface{}

CoerceForStorage transforms attributes prior to being saved in a persistent store.

func ConcatAuthKeys Uses

func ConcatAuthKeys(a, b string) string

ConcatAuthKeys concatenates the two sets of authorised keys, interposing a newline if necessary, because authorised keys are newline-separated.

func ConfigDefaults Uses

func ConfigDefaults() map[string]interface{}

ConfigDefaults returns the config default values to be used for any new model where there is no value yet defined.

func PreferredSeries Uses

func PreferredSeries(cfg HasDefaultSeries) string

PreferredSeries returns the preferred series to use when a charm does not explicitly specify a series.

func ProcessDeprecatedAttributes Uses

func ProcessDeprecatedAttributes(attrs map[string]interface{}) map[string]interface{}

ProcessDeprecatedAttributes gathers any deprecated attributes in attrs and adds or replaces them with new name value pairs for the replacement attrs. Ths ensures that older versions of Juju which require that deprecated attribute values still be used will work as expected.

func ProxyConfigMap Uses

func ProxyConfigMap(proxySettings proxy.Settings) map[string]interface{}

ProxyConfigMap returns a map suitable to be applied to a Config to update proxy settings.

func Schema Uses

func Schema(extra environschema.Fields) (environschema.Fields, error)

Schema returns a configuration schema that includes both the given extra fields and all the fields defined in this package. It returns an error if extra defines any fields defined in this package.

func SpecializeCharmRepo Uses

func SpecializeCharmRepo(repo charmrepo.Interface, cfg *Config) charmrepo.Interface

SpecializeCharmRepo customizes a repository for a given configuration. It returns a charm repository with test mode enabled if applicable.

func Validate Uses

func Validate(cfg, old *Config) error

Validate ensures that config is a valid configuration. If old is not nil, it holds the previous environment configuration for consideration when validating changes.

type AttributeDefaultValues Uses

type AttributeDefaultValues struct {
    // Default and Controller represent the values as set at those levels.
    Default    interface{} `json:"default,omitempty" yaml:"default,omitempty"`
    Controller interface{} `json:"controller,omitempty" yaml:"controller,omitempty"`
    // Regions is a slice of Region representing the values as set in each
    // region.
    Regions []RegionDefaultValue `json:"regions,omitempty" yaml:"regions,omitempty"`
}

AttributeDefaultValues represents all the default values at each level for a given setting.

type Config Uses

type Config struct {
    // contains filtered or unexported fields
}

Config holds an immutable environment configuration.

func New Uses

func New(withDefaults Defaulting, attrs map[string]interface{}) (*Config, error)

New returns a new configuration. Fields that are common to all environment providers are verified. If useDefaults is UseDefaults, default values will be taken from the environment.

"ca-cert-path" and "ca-private-key-path" are translated into the "ca-cert" and "ca-private-key" values. If not specified, CA details will be read from:

~/.local/share/juju/<name>-cert.pem
~/.local/share/juju/<name>-private-key.pem

if $XDG_DATA_HOME is defined it will be used instead of ~/.local/share

func (*Config) AgentMetadataURL Uses

func (c *Config) AgentMetadataURL() (string, bool)

AgentMetadataURL returns the URL that locates the agent tarballs and metadata, and whether it has been set.

func (*Config) AgentStream Uses

func (c *Config) AgentStream() string

AgentStream returns the simplestreams stream used to identify which tools to use when when bootstrapping or upgrading an environment.

func (*Config) AgentVersion Uses

func (c *Config) AgentVersion() (version.Number, bool)

AgentVersion returns the proposed version number for the agent tools, and whether it has been set. Once an environment is bootstrapped, this must always be valid.

func (*Config) AllAttrs Uses

func (c *Config) AllAttrs() map[string]interface{}

AllAttrs returns a copy of the raw configuration attributes.

func (*Config) Apply Uses

func (c *Config) Apply(attrs map[string]interface{}) (*Config, error)

Apply returns a new configuration that has the attributes of c plus attrs.

func (*Config) AptFTPProxy Uses

func (c *Config) AptFTPProxy() string

AptFTPProxy returns the apt ftp proxy for the environment. Falls back to the default ftp-proxy if not specified.

func (*Config) AptHTTPProxy Uses

func (c *Config) AptHTTPProxy() string

AptHTTPProxy returns the apt http proxy for the environment. Falls back to the default http-proxy if not specified.

func (*Config) AptHTTPSProxy Uses

func (c *Config) AptHTTPSProxy() string

AptHTTPSProxy returns the apt https proxy for the environment. Falls back to the default https-proxy if not specified.

func (*Config) AptMirror Uses

func (c *Config) AptMirror() string

AptMirror sets the apt mirror for the environment.

func (*Config) AptNoProxy Uses

func (c *Config) AptNoProxy() string

AptNoProxy returns the 'apt-no-proxy' for the environment.

func (*Config) AptProxySettings Uses

func (c *Config) AptProxySettings() proxy.Settings

AptProxySettings returns all three proxy settings; http, https and ftp.

func (*Config) AuthorizedKeys Uses

func (c *Config) AuthorizedKeys() string

AuthorizedKeys returns the content for ssh's authorized_keys file.

func (*Config) AutomaticallyRetryHooks Uses

func (c *Config) AutomaticallyRetryHooks() bool

AutomaticallyRetryHooks returns whether we should automatically retry hooks. By default this should be true.

func (*Config) BackupDir Uses

func (c *Config) BackupDir() string

BackupDir returns the configuration string for the temporary files backup.

func (*Config) CloudInitUserData Uses

func (c *Config) CloudInitUserData() map[string]interface{}

CloudInitUserData returns a copy of the raw user data attributes that were specified by the user.

func (*Config) ContainerImageMetadataURL Uses

func (c *Config) ContainerImageMetadataURL() (string, bool)

ContainerImageMetadataURL returns the URL at which the metadata used to locate container OS image ids is located, and whether it has been set.

func (*Config) ContainerImageStream Uses

func (c *Config) ContainerImageStream() string

ContainerImageStream returns the simplestreams stream used to identify which image ids to search when starting a container.

func (*Config) ContainerInheritProperties Uses

func (c *Config) ContainerInheritProperties() string

ContainerInheritProperties returns a copy of the raw user data keys that were specified by the user.

func (*Config) ContainerNetworkingMethod Uses

func (c *Config) ContainerNetworkingMethod() string

ContainerNetworkingMethod returns the method with which containers network should be set up.

func (*Config) DefaultSeries Uses

func (c *Config) DefaultSeries() (string, bool)

DefaultSeries returns the configured default Ubuntu series for the environment, and whether the default series was explicitly configured on the environment.

func (*Config) Development Uses

func (c *Config) Development() bool

Development returns whether the environment is in development mode.

func (*Config) DisableNetworkManagement Uses

func (c *Config) DisableNetworkManagement() (bool, bool)

DisableNetworkManagement reports whether Juju is allowed to configure and manage networking inside the environment.

func (*Config) EgressSubnets Uses

func (c *Config) EgressSubnets() []string

EgressSubnets are the source addresses from which traffic from this model originates if the model is deployed such that NAT or similar is in use.

func (*Config) EnableOSRefreshUpdate Uses

func (c *Config) EnableOSRefreshUpdate() bool

EnableOSRefreshUpdate returns whether or not newly provisioned instances should run their respective OS's update capability.

func (*Config) EnableOSUpgrade Uses

func (c *Config) EnableOSUpgrade() bool

EnableOSUpgrade returns whether or not newly provisioned instances should run their respective OS's upgrade capability.

func (*Config) FTPProxy Uses

func (c *Config) FTPProxy() string

FTPProxy returns the legacy ftp proxy for the environment.

func (*Config) FanConfig Uses

func (c *Config) FanConfig() (network.FanConfig, error)

FanConfig is the configuration of FAN network running in the model.

func (*Config) FirewallMode Uses

func (c *Config) FirewallMode() string

FirewallMode returns whether the firewall should manage ports per machine, globally, or not at all. (FwInstance, FwGlobal, or FwNone).

func (*Config) HTTPProxy Uses

func (c *Config) HTTPProxy() string

HTTPProxy returns the legacy http proxy for the environment.

func (*Config) HTTPSProxy Uses

func (c *Config) HTTPSProxy() string

HTTPSProxy returns the legacy https proxy for the environment.

func (*Config) HasJujuProxy Uses

func (c *Config) HasJujuProxy() bool

HasJujuProxy returns true if there is any proxy set using the new juju-proxy keys.

func (*Config) HasLegacyProxy Uses

func (c *Config) HasLegacyProxy() bool

HasLegacyProxy returns true if there is any proxy set using the old legacy proxy keys.

func (*Config) IgnoreMachineAddresses Uses

func (c *Config) IgnoreMachineAddresses() (bool, bool)

IgnoreMachineAddresses reports whether Juju will discover and store machine addresses on startup.

func (*Config) ImageMetadataURL Uses

func (c *Config) ImageMetadataURL() (string, bool)

ImageMetadataURL returns the URL at which the metadata used to locate image ids is located, and whether it has been set.

func (*Config) ImageStream Uses

func (c *Config) ImageStream() string

ImageStream returns the simplestreams stream used to identify which image ids to search when starting an instance.

func (*Config) JujuFTPProxy Uses

func (c *Config) JujuFTPProxy() string

JujuFTPProxy returns the ftp proxy for the environment.

func (*Config) JujuHTTPProxy Uses

func (c *Config) JujuHTTPProxy() string

JujuHTTPProxy returns the http proxy for the environment.

func (*Config) JujuHTTPSProxy Uses

func (c *Config) JujuHTTPSProxy() string

JujuHTTPSProxy returns the https proxy for the environment.

func (*Config) JujuNoProxy Uses

func (c *Config) JujuNoProxy() string

JujuNoProxy returns the 'no-proxy' for the environment. This value can contain CIDR values.

func (*Config) JujuProxySettings Uses

func (c *Config) JujuProxySettings() proxy.Settings

JujuProxySettings returns all four proxy settings that have been set using the juju- prefixed proxy settings. These values determine the current best practice for proxies.

func (*Config) LegacyProxySettings Uses

func (c *Config) LegacyProxySettings() proxy.Settings

LegacyProxySettings returns all four proxy settings; http, https, ftp, and no proxy. These are considered legacy as using these values will cause the environment to be updated, which has shown to not work in many cases. It is being kept to avoid breaking environments where it is sufficient.

func (*Config) LogFwdSyslog Uses

func (c *Config) LogFwdSyslog() (*syslog.RawConfig, bool)

LogFwdSyslog returns the syslog forwarding config.

func (*Config) LoggingConfig Uses

func (c *Config) LoggingConfig() string

LoggingConfig returns the configuration string for the loggers.

func (*Config) MaxActionResultsAge Uses

func (c *Config) MaxActionResultsAge() time.Duration

func (*Config) MaxActionResultsSizeMB Uses

func (c *Config) MaxActionResultsSizeMB() uint

func (*Config) MaxStatusHistoryAge Uses

func (c *Config) MaxStatusHistoryAge() time.Duration

MaxStatusHistoryAge is the maximum age of status history entries before being pruned.

func (*Config) MaxStatusHistorySizeMB Uses

func (c *Config) MaxStatusHistorySizeMB() uint

MaxStatusHistorySizeMB is the maximum size in MiB which the status history collection can grow to before being pruned.

func (*Config) Name Uses

func (c *Config) Name() string

Name returns the model name.

func (*Config) NetBondReconfigureDelay Uses

func (c *Config) NetBondReconfigureDelay() int

NetBondReconfigureDelay returns the duration in seconds that should be passed to the bridge script when bridging bonded interfaces.

func (*Config) NoProxy Uses

func (c *Config) NoProxy() string

NoProxy returns the legacy 'no-proxy' for the environment.

func (*Config) ProvisionerHarvestMode Uses

func (c *Config) ProvisionerHarvestMode() HarvestMode

ProvisionerHarvestMode reports the harvesting methodology the provisioner should take.

func (*Config) ProxySSH Uses

func (c *Config) ProxySSH() bool

ProxySSH returns a flag indicating whether SSH commands should be proxied through the API server.

func (*Config) Remove Uses

func (c *Config) Remove(attrs []string) (*Config, error)

Remove returns a new configuration that has the attributes of c minus attrs.

func (*Config) ResourceTags Uses

func (c *Config) ResourceTags() (map[string]string, bool)

ResourceTags returns a set of tags to set on environment resources that Juju creates and manages, if the provider supports them. These tags have no special meaning to Juju, but may be used for existing chargeback accounting schemes or other identification purposes.

func (*Config) SSLHostnameVerification Uses

func (c *Config) SSLHostnameVerification() bool

SSLHostnameVerification returns weather the environment has requested SSL hostname verification to be enabled.

func (*Config) SnapHTTPProxy Uses

func (c *Config) SnapHTTPProxy() string

SnapHTTPProxy returns the snap http proxy for the environment.

func (*Config) SnapHTTPSProxy Uses

func (c *Config) SnapHTTPSProxy() string

SnapHTTPSProxy returns the snap https proxy for the environment.

func (*Config) SnapProxySettings Uses

func (c *Config) SnapProxySettings() proxy.Settings

SnapProxySettings returns the two proxy settings; http, and https.

func (*Config) SnapStoreAssertions Uses

func (c *Config) SnapStoreAssertions() string

SnapStoreAssertions returns the snap store assertions for the environment.

func (*Config) SnapStoreProxy Uses

func (c *Config) SnapStoreProxy() string

SnapStoreProxy returns the snap store proxy for the environment.

func (*Config) StorageDefaultBlockSource Uses

func (c *Config) StorageDefaultBlockSource() (string, bool)

StorageDefaultBlockSource returns the default block storage source for the environment.

func (*Config) StorageDefaultFilesystemSource Uses

func (c *Config) StorageDefaultFilesystemSource() (string, bool)

StorageDefaultFilesystemSource returns the default filesystem storage source for the environment.

func (*Config) TestMode Uses

func (c *Config) TestMode() bool

TestMode indicates if the environment is intended for testing. In this case, accessing the charm store does not affect statistical data of the store.

func (*Config) TransmitVendorMetrics Uses

func (c *Config) TransmitVendorMetrics() bool

TransmitVendorMetrics returns whether the controller sends charm-collected metrics in this model for anonymized aggregate analytics. By default this should be true.

func (*Config) Type Uses

func (c *Config) Type() string

Type returns the model's cloud provider type.

func (*Config) UUID Uses

func (c *Config) UUID() string

UUID returns the uuid for the model.

func (*Config) UnknownAttrs Uses

func (c *Config) UnknownAttrs() map[string]interface{}

UnknownAttrs returns a copy of the raw configuration attributes that are supposedly specific to the environment type. They could also be wrong attributes, though. Only the specific environment implementation can tell.

func (*Config) UpdateStatusHookInterval Uses

func (c *Config) UpdateStatusHookInterval() time.Duration

UpdateStatusHookInterval is how often to run the charm update-status hook.

func (*Config) ValidateUnknownAttrs Uses

func (cfg *Config) ValidateUnknownAttrs(extrafields schema.Fields, defaults schema.Defaults) (map[string]interface{}, error)

ValidateUnknownAttrs checks the unknown attributes of the config against the supplied fields and defaults, and returns an error if any fails to validate. Unknown fields are warned about, but preserved, on the basis that they are reasonably likely to have been written by or for a version of juju that does recognise the fields, but that their presence is still anomalous to some degree and should be flagged (and that there is thereby a mechanism for observing fields that really are typos etc).

type ConfigSchemaSource Uses

type ConfigSchemaSource interface {
    // ConfigSchema returns extra config attributes specific
    // to this provider only.
    ConfigSchema() schema.Fields

    // ConfigDefaults returns the default values for the
    // provider specific config attributes.
    ConfigDefaults() schema.Defaults
}

ConfigSchemaSource instances provide information on config attributes and the default attribute values.

type ConfigValue Uses

type ConfigValue struct {
    // Value is the configuration value.
    Value interface{}

    // Source is the name of the inherited config
    // source from where the value originates.
    Source string
}

ConfigValue encapsulates a configuration value and its source.

type ConfigValues Uses

type ConfigValues map[string]ConfigValue

ConfigValues is a map of configuration values keyed by attribute name.

func (ConfigValues) AllAttrs Uses

func (c ConfigValues) AllAttrs() map[string]interface{}

AllAttrs returns just the attribute values from the config.

type Defaulting Uses

type Defaulting bool

Defaulting is a value that specifies whether a configuration creator should use defaults from the environment.

const (
    UseDefaults Defaulting = true
    NoDefaults  Defaulting = false
)

type HarvestMode Uses

type HarvestMode uint32

HarvestMode is a bit field which is used to store the harvesting behavior for Juju.

const (
    // HarvestNone signifies that Juju should not harvest any
    // machines.
    HarvestNone HarvestMode = 1 << iota
    // HarvestUnknown signifies that Juju should only harvest machines
    // which exist, but we don't know about.
    HarvestUnknown
    // HarvestDestroyed signifies that Juju should only harvest
    // machines which have been explicitly released by the user
    // through a destroy of an application/model/unit.
    HarvestDestroyed
    // HarvestAll signifies that Juju should harvest both unknown and
    // destroyed instances. ♫ Don't fear the reaper. ♫
    HarvestAll HarvestMode = HarvestUnknown | HarvestDestroyed
)

func ParseHarvestMode Uses

func ParseHarvestMode(description string) (HarvestMode, error)

ParseHarvestMode parses description of harvesting method and returns the representation.

func (HarvestMode) HarvestDestroyed Uses

func (method HarvestMode) HarvestDestroyed() bool

Destroyed returns whether or not the Destroyed harvesting flag is set.

func (HarvestMode) HarvestNone Uses

func (method HarvestMode) HarvestNone() bool

None returns whether or not the None harvesting flag is set.

func (HarvestMode) HarvestUnknown Uses

func (method HarvestMode) HarvestUnknown() bool

Unknown returns whether or not the Unknown harvesting flag is set.

func (HarvestMode) String Uses

func (method HarvestMode) String() string

String returns the description of the harvesting mode.

type HasDefaultSeries Uses

type HasDefaultSeries interface {
    DefaultSeries() (string, bool)
}

type ModelDefaultAttributes Uses

type ModelDefaultAttributes map[string]AttributeDefaultValues

ModelDefaultAttributes is a map of configuration values to a list of possible values.

type RegionDefaultValue Uses

type RegionDefaultValue struct {
    // Name represents the region name for this specific setting.
    Name string `json:"name" yaml:"name"`
    // Value is the value of the setting this represents in the named region.
    Value interface{} `json:"value" yaml:"value"`
}

RegionDefaultValue holds the region information for each region in DefaultSetting.

type Validator Uses

type Validator interface {
    // Validate ensures that cfg is a valid configuration.
    // If old is not nil, Validate should use it to determine
    // whether a configuration change is valid.
    //
    // TODO(axw) Validate should just return an error. We should
    // use a separate mechanism for updating config.
    Validate(cfg, old *Config) (valid *Config, _ error)
}

Validator is an interface for validating model configuration.

Package config imports 22 packages (graph) and is imported by 2313 packages. Updated 2019-08-22. Refresh now. Tools for package owners.