config

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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 ConfigExists() (bool, error)

func ConfigPath

func ConfigPath() (string, error)

func Dir

func Dir() (string, error)

func EnsureDir

func EnsureDir() (string, error)

func EnsureKeyringDir

func EnsureKeyringDir() (string, error)

func GetFavorite

func GetFavorite(name string) (int, error)

GetFavorite returns the stop number for a favorite alias.

func KeyringDir

func KeyringDir() (string, error)

func ListFavorites

func ListFavorites() (map[string]int, error)

ListFavorites returns all configured favorites.

func RemoveFavorite

func RemoveFavorite(name string) error

RemoveFavorite removes a favorite stop alias.

func SetFavorite

func SetFavorite(name string, stopNumber int) error

SetFavorite sets a favorite stop alias.

func WriteConfig

func WriteConfig(cfg File) error

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

func ReadConfig() (File, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL