config

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertValid

func AssertValid(c interface{}) error

AssertValid checks the fields in the structure and makes sure that they contain valid values as specified by the 'valid' flag. Empty fields are implicitly valid.

func IsZero

func IsZero(c interface{}) bool

IsZero returns whether or not the parameter is the zero value for its type. If the parameter is a struct, only the exported fields are considered.

Types

type CloudConfig

type CloudConfig struct {
	SSHAuthorizedKeys []string `yaml:"ssh_authorized_keys"`
	Coreos            struct {
		Etcd   Etcd   `yaml:"etcd"`
		Fleet  Fleet  `yaml:"fleet"`
		OEM    OEM    `yaml:"oem"`
		Update Update `yaml:"update"`
		Units  []Unit `yaml:"units"`
	} `yaml:"coreos"`
	WriteFiles        []File   `yaml:"write_files"`
	Hostname          string   `yaml:"hostname"`
	Users             []User   `yaml:"users"`
	ManageEtcHosts    EtcHosts `yaml:"manage_etc_hosts"`
	NetworkConfigPath string   `yaml:"-"`
	NetworkConfig     string   `yaml:"-"`
}

CloudConfig encapsulates the entire cloud-config configuration file and maps directly to YAML. Fields that cannot be set in the cloud-config (fields used for internal use) have the YAML tag '-' so that they aren't marshalled.

func NewCloudConfig

func NewCloudConfig(contents string) (*CloudConfig, error)

NewCloudConfig instantiates a new CloudConfig from the given contents (a string of YAML), returning any error encountered. It will ignore unknown fields but log encountering them.

func (CloudConfig) String

func (cc CloudConfig) String() string

type EtcHosts

type EtcHosts string

type Etcd

type Etcd struct {
	Addr                string `yaml:"addr"                  env:"ETCD_ADDR"`
	BindAddr            string `yaml:"bind-addr"             env:"ETCD_BIND_ADDR"`
	CAFile              string `yaml:"ca-file"               env:"ETCD_CA_FILE"`
	CertFile            string `yaml:"cert-file"             env:"ETCD_CERT_FILE"`
	ClusterActiveSize   string `yaml:"cluster-active-size"   env:"ETCD_CLUSTER_ACTIVE_SIZE"`
	ClusterRemoveDelay  string `yaml:"cluster-remove-delay"  env:"ETCD_CLUSTER_REMOVE_DELAY"`
	ClusterSyncInterval string `yaml:"cluster-sync-interval" env:"ETCD_CLUSTER_SYNC_INTERVAL"`
	Cors                string `yaml:"cors"                  env:"ETCD_CORS"`
	CPUProfileFile      string `yaml:"cpu-profile-file"      env:"ETCD_CPU_PROFILE_FILE"`
	DataDir             string `yaml:"data-dir"              env:"ETCD_DATA_DIR"`
	Discovery           string `yaml:"discovery"             env:"ETCD_DISCOVERY"`
	HTTPReadTimeout     string `yaml:"http-read-timeout"     env:"ETCD_HTTP_READ_TIMEOUT"`
	HTTPWriteTimeout    string `yaml:"http-write-timeout"    env:"ETCD_HTTP_WRITE_TIMEOUT"`
	KeyFile             string `yaml:"key-file"              env:"ETCD_KEY_FILE"`
	MaxClusterSize      string `yaml:"max-cluster-size"      env:"ETCD_MAX_CLUSTER_SIZE"`
	MaxResultBuffer     string `yaml:"max-result-buffer"     env:"ETCD_MAX_RESULT_BUFFER"`
	MaxRetryAttempts    string `yaml:"max-retry-attempts"    env:"ETCD_MAX_RETRY_ATTEMPTS"`
	Name                string `yaml:"name"                  env:"ETCD_NAME"`
	PeerAddr            string `yaml:"peer-addr"             env:"ETCD_PEER_ADDR"`
	PeerBindAddr        string `yaml:"peer-bind-addr"        env:"ETCD_PEER_BIND_ADDR"`
	PeerCAFile          string `yaml:"peer-ca-file"          env:"ETCD_PEER_CA_FILE"`
	PeerCertFile        string `yaml:"peer-cert-file"        env:"ETCD_PEER_CERT_FILE"`
	PeerKeyFile         string `yaml:"peer-key-file"         env:"ETCD_PEER_KEY_FILE"`
	Peers               string `yaml:"peers"                 env:"ETCD_PEERS"`
	PeersFile           string `yaml:"peers-file"            env:"ETCD_PEERS_FILE"`
	Snapshot            string `yaml:"snapshot"              env:"ETCD_SNAPSHOT"`
	Verbose             string `yaml:"verbose"               env:"ETCD_VERBOSE"`
	VeryVerbose         string `yaml:"very-verbose"          env:"ETCD_VERY_VERBOSE"`
}

type File

type File struct {
	Encoding           string `yaml:"-"`
	Content            string `yaml:"content"`
	Owner              string `yaml:"owner"`
	Path               string `yaml:"path"`
	RawFilePermissions string `yaml:"permissions"`
}

type Fleet

type Fleet struct {
	AgentTTL                string `yaml:"agent-ttl"                 env:"FLEET_AGENT_TTL"`
	EngineReconcileInterval string `yaml:"engine-reconcile-interval" env:"FLEET_ENGINE_RECONCILE_INTERVAL"`
	EtcdCAFile              string `yaml:"etcd-cafile"               env:"FLEET_ETCD_CAFILE"`
	EtcdCertFile            string `yaml:"etcd-certfile"             env:"FLEET_ETCD_CERTFILE"`
	EtcdKeyFile             string `yaml:"etcd-keyfile"              env:"FLEET_ETCD_KEYFILE"`
	EtcdRequestTimeout      string `yaml:"etcd-request-timeout"      env:"FLEET_ETCD_REQUEST_TIMEOUT"`
	EtcdServers             string `yaml:"etcd-servers"              env:"FLEET_ETCD_SERVERS"`
	Metadata                string `yaml:"metadata"                  env:"FLEET_METADATA"`
	PublicIP                string `yaml:"public-ip"                 env:"FLEET_PUBLIC_IP"`
	Verbosity               string `yaml:"verbosity"                 env:"FLEET_VERBOSITY"`
}

type OEM

type OEM struct {
	ID           string `yaml:"id"`
	Name         string `yaml:"name"`
	VersionID    string `yaml:"version-id"`
	HomeURL      string `yaml:"home-url"`
	BugReportURL string `yaml:"bug-report-url"`
}

type Unit

type Unit struct {
	Name    string `yaml:"name"`
	Mask    bool   `yaml:"mask"`
	Enable  bool   `yaml:"enable"`
	Runtime bool   `yaml:"runtime"`
	Content string `yaml:"content"`
	Command string `yaml:"command"`

	// For drop-in units, a cloudinit.conf is generated.
	// This is currently unbound in YAML (and hence unsettable in cloud-config files)
	// until the correct behaviour for multiple drop-in units is determined.
	DropIn bool `yaml:"-"`
}

func (*Unit) Group

func (u *Unit) Group() string

func (*Unit) Type

func (u *Unit) Type() string

type Update

type Update struct {
	RebootStrategy string `yaml:"reboot-strategy" env:"REBOOT_STRATEGY" valid:"best-effort,etcd-lock,reboot,off"`
	Group          string `yaml:"group"           env:"GROUP"`
	Server         string `yaml:"server"          env:"SERVER"`
}

type User

type User struct {
	Name                string   `yaml:"name"`
	PasswordHash        string   `yaml:"passwd"`
	SSHAuthorizedKeys   []string `yaml:"ssh-authorized-keys"`
	SSHImportGithubUser string   `yaml:"coreos-ssh-import-github"`
	SSHImportURL        string   `yaml:"coreos-ssh-import-url"`
	GECOS               string   `yaml:"gecos"`
	Homedir             string   `yaml:"homedir"`
	NoCreateHome        bool     `yaml:"no-create-home"`
	PrimaryGroup        string   `yaml:"primary-group"`
	Groups              []string `yaml:"groups"`
	NoUserGroup         bool     `yaml:"no-user-group"`
	System              bool     `yaml:"system"`
	NoLogInit           bool     `yaml:"no-log-init"`
}

Jump to

Keyboard shortcuts

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