Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureCLIConfigDir ¶
EnsureCLIConfigDir ensures that the CLI config directory exists. If it does not exist, it will be created. Returns the path to the directory.
func EnsureCLIConfigFile ¶
EnsureCLIConfigFile ensures that the CLI config file exists. If it does not exist, it will be created. Returns the path to the file.
func ProcessConfig ¶
ProcessConfig processes the CLI config provided from the config file. It sets default values for any missing fields. It also sets fields based on other fields.
Types ¶
type CLIConfig ¶
type CLIConfig struct { Server string `yaml:"server"` Port int `yaml:"port"` UseTLS bool `yaml:"use_tls"` APIKey string `yaml:"api_key"` // Though these are processed by ProcessConfig // they could also be provided if needed. Protocol string `yaml:"protocol"` BaseURL string `yaml:"base_url"` // These are not used by the CLI, but are used by the application ConfigDir string `yaml:"-"` }
func GetCLIConfig ¶
func ReadConfigFile ¶
ReadConfigFile reads the CLI config file and returns a CLIConfig struct.
Click to show internal directories.
Click to hide internal directories.