Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2015 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// DevMode controls if we are in a development mode which
	// avoids persistent storage.
	DevMode bool

	// StateDir is where we store our state
	StateDir string

	// AllocDir is where we store data for allocations
	AllocDir string

	// LogOutput is the destination for logs
	LogOutput io.Writer

	// Region is the clients region
	Region string

	// Network interface to be used in network fingerprinting
	NetworkInterface string

	// Network speed is the default speed of network interfaces if they can not
	// be determined dynamically.
	NetworkSpeed int

	// Servers is a list of known server addresses. These are as "host:port"
	Servers []string

	// RPCHandler can be provided to avoid network traffic if the
	// server is running locally.
	RPCHandler RPCHandler

	// Node provides the base node
	Node *structs.Node

	// Options provides arbitrary key-value configuration for nomad internals,
	// like fingerprinters and drivers. The format is:
	//
	//	namespace.option = value
	Options map[string]string
}

Config is used to parameterize and configure the behavior of the client

func (*Config) Read

func (c *Config) Read(id string) string

Read returns the specified configuration value or "".

func (*Config) ReadBool added in v0.2.0

func (c *Config) ReadBool(id string) (bool, error)

ReadBool parses the specified option as a boolean.

func (*Config) ReadBoolDefault added in v0.2.0

func (c *Config) ReadBoolDefault(id string, defaultValue bool) bool

ReadBoolDefault tries to parse the specified option as a boolean. If there is an error in parsing, the default option is returned.

func (*Config) ReadDefault

func (c *Config) ReadDefault(id string, defaultValue string) string

ReadDefault returns the specified configuration value, or the specified default value if none is set.

func (*Config) ReadStringListToMap added in v0.2.1

func (c *Config) ReadStringListToMap(key string) map[string]struct{}

ReadStringListToMap tries to parse the specified option as a comma seperated list. If there is an error in parsing, an empty list is returned.

type RPCHandler

type RPCHandler interface {
	RPC(method string, args interface{}, reply interface{}) error
}

RPCHandler can be provided to the Client if there is a local server to avoid going over the network. If not provided, the Client will maintain a connection pool to the servers

Jump to

Keyboard shortcuts

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