Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { HomeDir string `long:"appdata" description:"Path to application home directory"` Host string `long:"host" description:"hcAutonomywww host"` RawJSON bool `short:"j" long:"json" description:"Print raw JSON output"` ShowVersion bool `short:"V" long:"version" description:"Display version information and exit"` Verbose bool `short:"v" long:"verbose" description:"Print verbose output"` Version string // cli version WalletHost string // Wallet host WalletCert string // Wallet GRPC certificate FaucetHost string // Testnet faucet host CSRF string // CSRF header token Identity *identity.FullIdentity // User identity Cookies []*http.Cookie // User cookies // contains filtered or unexported fields }
func Load ¶
Load initializes and parses the config using a config file and command line options.
The configuration proceeds as follows:
- Start with a default config with sane settings
- Pre-parse the command line to check for an alternative config file
- Load configuration file overwriting defaults with any specified options
- Parse CLI options and overwrite/add any specified options
The above results in hcAutonomywwwcli functioning properly without any config settings while still allowing the user to override settings with config files and command line options. Command line options always take precedence.
func (*Config) SaveIdentity ¶
func (cfg *Config) SaveIdentity(id *identity.FullIdentity) error
Click to show internal directories.
Click to hide internal directories.