Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigExists() (bool, error)
- func ConfigPath() (string, error)
- func Dir() (string, error)
- func EnsureDir() (string, error)
- func EnsureKeyringDir() (string, error)
- func GetFavorite(name string) (int, error)
- func KeyringDir() (string, error)
- func ListFavorites() (map[string]int, error)
- func RemoveFavorite(name string) error
- func SetFavorite(name string, stopNumber int) error
- func WriteConfig(cfg File) error
- type File
Constants ¶
View Source
const AppName = "delijn"
Variables ¶
View Source
var ErrFavoriteNotFound = errors.New("favorite not found")
ErrFavoriteNotFound is returned when a favorite alias doesn't exist.
Functions ¶
func ConfigExists ¶
func ConfigPath ¶
func EnsureKeyringDir ¶
func GetFavorite ¶
GetFavorite returns the stop number for a favorite alias.
func KeyringDir ¶
func ListFavorites ¶
ListFavorites returns all configured favorites.
func RemoveFavorite ¶
RemoveFavorite removes a favorite stop alias.
func SetFavorite ¶
SetFavorite sets a favorite stop alias.
func WriteConfig ¶
Types ¶
type File ¶
type File struct {
Favorites map[string]int `yaml:"favorites,omitempty"`
DefaultStop string `yaml:"default_stop,omitempty"`
KeyringBackend string `yaml:"keyring_backend,omitempty"`
WatchInterval int `yaml:"watch_interval,omitempty"`
Timezone string `yaml:"timezone,omitempty"`
}
func ReadConfig ¶
Click to show internal directories.
Click to hide internal directories.