config

package
v0.3.1-rc3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_IMAGE_VERSION = "v0.3.1"
	CONSOLE_CONTAINER     = "console"
	DOCKER_BIN            = "/usr/bin/docker"
	DOCKER_SYSTEM_HOME    = "/var/lib/system-docker"
	DOCKER_SYSTEM_HOST    = "unix:///var/run/system-docker.sock"
	DOCKER_HOST           = "unix:///var/run/docker.sock"
	IMAGES_PATH           = "/"
	IMAGES_PATTERN        = "images*.tar"
	SYS_INIT              = "/sbin/init-sys"
	USER_INIT             = "/sbin/init-user"
	MODULES_ARCHIVE       = "/modules.tar"
	DEBUG                 = false

	LABEL         = "label"
	HASH          = "io.rancher.os.hash"
	ID            = "io.rancher.os.id"
	DETACH        = "io.rancher.os.detach"
	REMOVE        = "io.rancher.os.remove"
	CREATE_ONLY   = "io.rancher.os.createonly"
	RELOAD_CONFIG = "io.rancher.os.reloadconfig"
	SCOPE         = "io.rancher.os.scope"
	SYSTEM        = "system"
)

Variables

View Source
var (
	VERSION           string
	IMAGE_VERSION     string
	CloudConfigFile   = "/var/lib/rancher/conf/cloud-config-rancher.yml"
	ConfigFile        = "/var/lib/rancher/conf/rancher.yml"
	PrivateConfigFile = "/var/lib/rancher/conf/rancher-private.yml"
)

Functions

func DummyMarshall

func DummyMarshall(value string) interface{}

func Dump added in v0.2.0

func Dump(private, full bool) (string, error)

func FilterGlobalConfig

func FilterGlobalConfig(input []string) []string

func RunInitFuncs

func RunInitFuncs(cfg *Config, initFuncs []InitFunc) error

Types

type CloudInit

type CloudInit struct {
	Datasources []string `yaml:"datasources,omitempty"`
}

type Config

type Config struct {
	Environment         map[string]string                 `yaml:"environment,omitempty"`
	Services            map[string]*project.ServiceConfig `yaml:"services,omitempty"`
	BootstrapContainers map[string]*project.ServiceConfig `yaml:"bootstrap_containers,omitempty"`
	BootstrapDocker     DockerConfig                      `yaml:"bootstrap_docker,omitempty"`
	CloudInit           CloudInit                         `yaml:"cloud_init,omitempty"`
	Console             ConsoleConfig                     `yaml:"console,omitempty"`
	Debug               bool                              `yaml:"debug,omitempty"`
	Disable             []string                          `yaml:"disable,omitempty"`
	ServicesInclude     map[string]bool                   `yaml:"services_include,omitempty"`
	Modules             []string                          `yaml:"modules,omitempty"`
	Network             NetworkConfig                     `yaml:"network,omitempty"`
	Repositories        Repositories                      `yaml:"repositories,omitempty"`
	Ssh                 SshConfig                         `yaml:"ssh,omitempty"`
	State               StateConfig                       `yaml:"state,omitempty"`
	SystemContainers    map[string]*project.ServiceConfig `yaml:"system_containers,omitempty"`
	SystemDocker        DockerConfig                      `yaml:"system_docker,omitempty"`
	Upgrade             UpgradeConfig                     `yaml:"upgrade,omitempty"`
	UserContainers      []ContainerConfig                 `yaml:"user_containers,omitempty"`
	UserDocker          DockerConfig                      `yaml:"user_docker,omitempty"`
}

func LoadConfig

func LoadConfig() (*Config, error)

func NewConfig

func NewConfig() *Config

func (*Config) Get added in v0.2.0

func (c *Config) Get(key string) (interface{}, error)

func (*Config) Import added in v0.2.0

func (c *Config) Import(bytes []byte) error

func (*Config) Merge

func (c *Config) Merge(bytes []byte) error

func (*Config) Reload

func (c *Config) Reload() error

func (*Config) Set added in v0.2.0

func (c *Config) Set(key string, value interface{}) error

func (*Config) SetConfig added in v0.2.0

func (c *Config) SetConfig(newConfig *Config) error

This function only sets "non-empty" values

type ConsoleConfig added in v0.2.0

type ConsoleConfig struct {
	Tail       bool `yaml:"tail,omitempty"`
	Persistent bool `yaml:"persistent,omitempty"`
}

type ContainerConfig

type ContainerConfig struct {
	Id             string                 `yaml:"id,omitempty"`
	Cmd            string                 `yaml:"run,omitempty"`
	MigrateVolumes bool                   `yaml:"migrate_volumes,omitempty"`
	ReloadConfig   bool                   `yaml:"reload_config,omitempty"`
	CreateOnly     bool                   `yaml:create_only,omitempty`
	Service        *project.ServiceConfig `yaml:service,omitempty`
}

type DnsConfig added in v0.2.0

type DnsConfig struct {
	Nameservers []string `yaml:"nameservers,flow,omitempty"`
	Search      []string `yaml:"search,flow,omitempty"`
	Domain      string   `yaml:"domain,omitempty"`
}

type DockerConfig added in v0.2.0

type DockerConfig struct {
	TLS        bool     `yaml:"tls,omitempty"`
	TLSArgs    []string `yaml:"tls_args,flow,omitempty"`
	Args       []string `yaml:"args,flow,omitempty"`
	ExtraArgs  []string `yaml:"extra_args,flow,omitempty"`
	ServerCert string   `yaml:"server_cert,omitempty"`
	ServerKey  string   `yaml:"server_key,omitempty"`
	CACert     string   `yaml:"ca_cert,omitempty"`
	CAKey      string   `yaml:"ca_key,omitempty"`
}

func (*DockerConfig) BridgeConfig added in v0.3.0

func (d *DockerConfig) BridgeConfig() (string, string)

type InitFunc

type InitFunc func(*Config) error

type InterfaceConfig

type InterfaceConfig struct {
	Match   string `yaml:"match,omitempty"`
	DHCP    bool   `yaml:"dhcp,omitempty"`
	Address string `yaml:"address,omitempty"`
	IPV4LL  bool   `yaml:"ipv4ll,omitempty"`
	Gateway string `yaml:"gateway,omitempty"`
	MTU     int    `yaml:"mtu,omitempty"`
	Bridge  bool   `yaml:"bridge,omitempty"`
}

type NetworkConfig

type NetworkConfig struct {
	Dns        DnsConfig                  `yaml:"dns,omitempty"`
	Interfaces map[string]InterfaceConfig `yaml:"interfaces,omitempty"`
	PostRun    *ContainerConfig           `yaml:"post_run,omitempty"`
}

type Repositories added in v0.3.0

type Repositories map[string]Repository

func (Repositories) ToArray added in v0.3.0

func (r Repositories) ToArray() []string

type Repository added in v0.3.0

type Repository struct {
	Url string `yaml:url,omitempty`
}

type SshConfig added in v0.2.0

type SshConfig struct {
	Keys map[string]string `yaml:"keys,omitempty"`
}

type StateConfig added in v0.2.0

type StateConfig struct {
	FsType     string   `yaml:"fstype,omitempty"`
	Dev        string   `yaml:"dev,omitempty"`
	Required   bool     `yaml:"required,omitempty"`
	Autoformat []string `yaml:"autoformat,omitempty"`
}

type UpgradeConfig added in v0.2.0

type UpgradeConfig struct {
	Url      string `yaml:"url,omitempty"`
	Image    string `yaml:"image,omitempty"`
	Rollback string `yaml:"rollback,omitempty"`
}

Jump to

Keyboard shortcuts

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