config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	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
)

Variables

View Source
var (
	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 {
	Addons              map[string]Config `yaml:"addons,omitempty"`
	BootstrapContainers []ContainerConfig `yaml:"bootstrap_containers,omitempty"`
	CloudInit           CloudInit         `yaml:"cloud_init,omitempty"`
	Console             ConsoleConfig     `yaml:"console,omitempty"`
	Debug               bool              `yaml:"debug,omitempty"`
	Disable             []string          `yaml:"disable,omitempty"`
	EnabledAddons       []string          `yaml:"enabled_addons,omitempty"`
	Modules             []string          `yaml:"modules,omitempty"`
	Network             NetworkConfig     `yaml:"network,omitempty"`
	Ssh                 SshConfig         `yaml:"ssh,omitempty"`
	State               StateConfig       `yaml:"state,omitempty"`
	SystemContainers    []ContainerConfig `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`
}

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"`
	ServerCert string   `yaml:"server_cert,omitempty"`
	ServerKey  string   `yaml:"server_key,omitempty"`
	CACert     string   `yaml:"ca_cert,omitempty"`
	CAKey      string   `yaml:"ca_key,omitempty"`
}

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"`
	Gateway string `yaml:"gateway,omitempty"`
	MTU     int    `yaml:"mtu,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 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