config

package
v0.0.0-...-0dec3e3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2014 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=docker
	DOCKER_RESERVED_PORT     = 2375
	DOCKER_RESERVED_SSL_PORT = 2376

	SSH_PORT = 22

	AGENT_INTROSPECTION_PORT = 51678
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ClusterArn     string
	APIEndpoint    string
	APIPort        uint16
	DockerEndpoint string
	AWSRegion      string `missing:"warn"`
	ReservedPorts  []uint16
}

func DefaultConfig

func DefaultConfig() Config

func EC2MetadataConfig

func EC2MetadataConfig() Config

func EnvironmentConfig

func EnvironmentConfig() Config

EnvironmentConfig reads the given configs from the environment and attempts to convert them to the given type

func FileConfig

func FileConfig() Config

func NewConfig

func NewConfig() (*Config, error)

func (*Config) CheckMissing

func (cfg *Config) CheckMissing()

CheckMissing checks all zero-valued fields for tags of the form missing:STRING and acts based on that string. Current options are: fatal, warn. Fatal will result in a fatal error, warn will result in a warning that the field is missing being logged

func (*Config) Complete

func (cfg *Config) Complete() bool

Complete returns true if all fields of the config are populated / nonzero

func (*Config) Merge

func (lhs *Config) Merge(rhs Config) *Config

Merge merges two config files, preferring the ones on the left. Any nil or zero values present in the left that are not present in the right will be overridden

type ConfigReader

type ConfigReader interface {
	ReadConfig() *Config
}

Jump to

Keyboard shortcuts

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