config

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VERSION            = "0.0.1"
	CONSOLE_CONTAINER  = "console"
	DOCKER_BIN         = "/usr/bin/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 (
	ConfigFile = "/var/lib/rancher/conf/rancher.yml"
)

Functions

func DummyMarshall

func DummyMarshall(value string) interface{}

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 {
	Debug            bool              `yaml:"debug,omitempty"`
	Disable          []string          `yaml:"disable,omitempty"`
	Dns              []string          `yaml:"dns,flow,omitempty"`
	Rescue           bool              `yaml:"rescue,omitempty"`
	RescueContainer  *ContainerConfig  `yaml:"rescue_container,omitempty"`
	State            ConfigState       `yaml:"state,omitempty"`
	Userdocker       UserDockerInfo    `yaml:"userdocker,omitempty"`
	OsUpgradeChannel string            `yaml:"os_upgrade_channel,omitempty"`
	SystemContainers []ContainerConfig `yaml:"system_containers,omitempty"`
	SystemDockerArgs []string          `yaml:"system_docker_args,flow,omitempty"`
	Modules          []string          `yaml:"modules,omitempty"`
	CloudInit        CloudInit         `yaml:"cloud_init"`
	SshInfo          SshInfo           `yaml:"ssh"`
	EnabledAddons    []string          `yaml:"enabledAddons,omitempty"`
	Addons           map[string]Config `yaml:"addons,omitempty"`
	Network          NetworkConfig     `yaml:"network_config,omitempty"`
}

func LoadConfig

func LoadConfig() (*Config, error)

func NewConfig

func NewConfig() *Config

func (*Config) ClearReadOnly

func (c *Config) ClearReadOnly()

func (*Config) Dump

func (c *Config) Dump() (string, error)

func (*Config) Merge

func (c *Config) Merge(newConfig Config) (bool, error)

func (*Config) PrivilegedMerge

func (c *Config) PrivilegedMerge(newConfig Config) (bool, error)

func (*Config) Reload

func (c *Config) Reload() error

func (Config) Save

func (c Config) Save() error

type ConfigState

type ConfigState struct {
	FsType   string `yaml:"fstype"`
	Dev      string `yaml:"dev"`
	Required bool   `yaml:"required"`
}

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"`
}

type InitFunc

type InitFunc func(*Config) error

type InterfaceConfig

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

type NetworkConfig

type NetworkConfig struct {
	Interfaces []InterfaceConfig `yaml:"config"`
	PostRun    *ContainerConfig  `yaml:"post_run"`
}

type SshInfo

type SshInfo struct {
	Keys map[string]string
}

type UserDockerInfo

type UserDockerInfo struct {
	UseTLS        bool   `yaml:"use_tls"`
	TLSServerCert string `yaml:"tls_server_cert"`
	TLSServerKey  string `yaml:"tls_server_key"`
	TLSCACert     string `yaml:"tls_ca_cert"`
}

Jump to

Keyboard shortcuts

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