Added Config.Options so we can support arbitrary key-value configuration

This commit is contained in:
Chris Bednarski
2015-08-31 19:48:59 -07:00
parent 410fe9986d
commit dc97c6df9e

View File

@@ -40,4 +40,27 @@ type Config struct {
// 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
}
func NewConfig() Config {
config := Config{
Node: &structs.Node{},
Options: map[string]string{},
}
return config
}
// GetOpt returns the specified configuration value or "".
func (c *Config) Read(id string) string {
val, ok := c.Options[id]
if !ok {
return ""
}
return val
}