Documentation
¶
Overview ¶
Package config merges eightsleep's settings: root flags, then EIGHTSLEEP_ and EIGHTCTL_ environment variables, then the YAML config file, the precedence eightctl's viper setup had.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Prefixes = []string{"EIGHTSLEEP_", "EIGHTCTL_"}
Prefixes are the environment variable prefixes, most preferred first. EIGHTCTL_ is the name every existing setup uses.
Functions ¶
func DefaultPath ¶
DefaultPath is ~/.config/eightsleep/config.yaml when it exists, else the eightctl path every existing setup uses.
Types ¶
type Flags ¶
type Flags struct {
Config string
Email string
Password string
UserID string
ClientID string
ClientSecret string
Timezone string
Output string
Verbose bool
Quiet bool
}
Flags are the root flag values. Empty means not given.
type Settings ¶
type Settings struct {
Email string
Password string
UserID string
ClientID string
ClientSecret string
// Timezone is an IANA zone name or "local".
Timezone string
// Output is the human output format: table, json or csv.
Output string
Verbose bool
// Quiet suppresses the config-file notice.
Quiet bool
// AwayQuiet suppresses the away on/off confirmation line. eightctl read
// it from EIGHTCTL_QUIET or the config's quiet key.
AwayQuiet bool
// Path is the config file that was read, or empty.
Path string
// Data is that file's contents, for the daemon's schedule.
Data []byte
// Mode is the file's permission bits.
Mode fs.FileMode
}
Settings are the merged values.