Documentation
¶
Index ¶
- Variables
- type Config
- func (c *Config) Copy() *Config
- func (c *Config) Read(id string) string
- func (c *Config) ReadBool(id string) (bool, error)
- func (c *Config) ReadBoolDefault(id string, defaultValue bool) bool
- func (c *Config) ReadDefault(id string, defaultValue string) string
- func (c *Config) ReadStringListToMap(key string) map[string]struct{}
- func (c *Config) ReadStringListToMapDefault(key, defaultValue string) map[string]struct{}
- type RPCHandler
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultEnvBlacklist is the default set of environment variables that are // filtered when passing the environment variables of the host to a task. DefaultEnvBlacklist = strings.Join([]string{ "CONSUL_TOKEN", "VAULT_TOKEN", "ATLAS_TOKEN", "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN", "GOOGLE_APPLICATION_CREDENTIALS", }, ",") // DefaulUserBlacklist is the default set of users that tasks are not // allowed to run as when using a driver in "user.checked_drivers" DefaultUserBlacklist = strings.Join([]string{ "root", "Administrator", }, ",") // DefaultUserCheckedDrivers is the set of drivers we apply the user // blacklist onto. For virtualized drivers it often doesn't make sense to // make this stipulation so by default they are ignored. DefaultUserCheckedDrivers = strings.Join([]string{ "exec", "qemu", "java", }, ",") )
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
// MaxKillTimeout allows capping the user-specifiable KillTimeout. If the
// task's KillTimeout is greater than the MaxKillTimeout, MaxKillTimeout is
// used.
MaxKillTimeout time.Duration
// 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
// ClientMaxPort is the upper range of the ports that the client uses for
// communicating with plugin subsystems over loopback
ClientMaxPort uint
// ClientMinPort is the lower range of the ports that the client uses for
// communicating with plugin subsystems over loopback
ClientMinPort uint
// GloballyReservedPorts are ports that are reserved across all network
// devices and IPs.
GloballyReservedPorts []int
// Options provides arbitrary key-value configuration for nomad internals,
// like fingerprinters and drivers. The format is:
//
// namespace.option = value
Options map[string]string
// Version is the version of the Nomad client
Version string
// Revision is the commit number of the Nomad client
Revision string
}
Config is used to parameterize and configure the behavior of the client
func (*Config) ReadBoolDefault ¶ added in v0.2.0
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 ¶
ReadDefault returns the specified configuration value, or the specified default value if none is set.
func (*Config) ReadStringListToMap ¶ added in v0.2.1
ReadStringListToMap tries to parse the specified option as a comma seperated list. If there is an error in parsing, an empty list is returned.
func (*Config) ReadStringListToMapDefault ¶ added in v0.3.2
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 ¶
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