config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Dir = filepath.Join(os.Getenv("LOCALAPPDATA"), "giwh")

	Path                  = filepath.Join(Dir, "config.toml")
	WishHistoryPath       = filepath.Join(Dir, "wish_history.json")
	WishHistoryBackupPath = filepath.Join(Dir, "wish_history_backup.json")

	WishHistory wish.Items

	GetAuthInfo    = config.GetAuthInfo
	UpdateAuthInfo = config.UpdateAuthInfo
	GetLanguage    = func() string { return config.Language }
	SetLanguage    = func(lang string) { config.Language = lang }
	Save           = func() error { return config.Save() }
)

Functions

func SaveWishHistory

func SaveWishHistory() error

Types

type Config

type Config struct {
	Language  string             `toml:"language"`
	AuthInfos []fetcher.AuthInfo `toml:"auth_infos"`
}

func Load

func Load(filename string) (*Config, error)

func (*Config) GetAuthInfo

func (config *Config) GetAuthInfo(uid string) (fetcher.AuthInfo, bool)

func (*Config) Save

func (config *Config) Save() error

func (*Config) UpdateAuthInfo

func (config *Config) UpdateAuthInfo(authInfo fetcher.AuthInfo)

Jump to

Keyboard shortcuts

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