Documentation ¶
Overview ¶
Package config implements the configuration management system.
This package contains the logic to interact with the configuration options of taskcluster-cli. It takes care of initializing, serializing, and loading all of the configuration values necessary for the application to function.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Configuration contains the current configuration values. Configuration map[string]map[string]interface{} // OptionsDefinitions is a map of all the OptionDefinitions, by command. OptionsDefinitions = make(map[string]map[string]OptionDefinition) // Credentials is the client credentials, if present. Credentials *client.Credentials )
Functions ¶
func Load ¶
Load will load configuration file, and initialize a default configuration if no configuration is present. This only returns an error if a configuration file is present, but we are unable to parse it.
func RegisterOptions ¶
func RegisterOptions(command string, options map[string]OptionDefinition)
RegisterOptions takes in the name of the command and an map of OptionDefinition objects
func RootURL ¶
func RootURL() string
Defer erroring out on a missing RootURL until we actually need one..
func SetRootURL ¶
func SetRootURL(newRootURL string)
set the root URL -- this is used only for testing
Types ¶
type OptionDefinition ¶
type OptionDefinition struct { Description string // Description of the config option Default interface{} // Default value Env string // Environment variable to attempt to load from (optional) Parse bool // True, if string input should be parsed as JSON Validate func(value interface{}) error }
A OptionDefinition is something with a default value and a validator. Only requirement is that values are JSON structures.