Documentation ¶
Index ¶
- Variables
- func CheckConfig(config *Config) error
- func CheckConfigDirectory() error
- func CreateTable(r aqi.Response, table *tablewriter.Table, all bool)
- func FillTable(r aqi.Response, table *tablewriter.Table, all bool)
- func SaveConfig(config Config) error
- func ShowSelectionMenu(stationNames []string, message string) ([]string, error)
- type AirConfig
- type Config
- type Stations
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigDirPath = filepath.Join(usr.HomeDir, ".air")
View Source
var ConfigFilePath = filepath.Join(ConfigDirPath, "aqi")
Functions ¶
func CheckConfig ¶
func CheckConfigDirectory ¶
func CheckConfigDirectory() error
CheckConfigDirectory checks if config directory `$HOME/.air` is present. If not present, atttempts to create one.
func CreateTable ¶
func CreateTable(r aqi.Response, table *tablewriter.Table, all bool)
CreateTable creates table based on response data.
func FillTable ¶
func FillTable(r aqi.Response, table *tablewriter.Table, all bool)
FillTable draws table to stdout based on response values from the API.
func SaveConfig ¶
SaveConfig writes new/updated config to the config file.
Types ¶
type Config ¶
type Config struct { ApiKey string `yaml:"apiKey,omitempty"` Stations map[string]Stations `yaml:"stations,omitempty"` }
Config store configuration for the CLI.
func GetCurrentConfig ¶
func (*Config) UpdateApiKey ¶
Click to show internal directories.
Click to hide internal directories.