config

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() string

func KindleConfigPath

func KindleConfigPath() string

func LoadKindleConfig

func LoadKindleConfig() (zlib.KindleConfig, error)

func LoadKindleConfigFrom added in v0.0.9

func LoadKindleConfigFrom(path string) (zlib.KindleConfig, error)

func LoadWeRead added in v0.0.13

func LoadWeRead() (weread.Credentials, error)

LoadWeRead returns the saved WeRead credentials. A missing file reports weread.ErrNotLoggedIn.

func RemoveWeRead added in v0.0.13

func RemoveWeRead() (bool, error)

RemoveWeRead deletes the saved credentials and reports whether a file existed.

func SaveConfig

func SaveConfig(c Config) error

func SaveKindleConfig

func SaveKindleConfig(cfg zlib.KindleConfig) error

func SaveKindleConfigTo added in v0.0.9

func SaveKindleConfigTo(path string, cfg zlib.KindleConfig) error

func SaveSession

func SaveSession(s Session) error

func SaveWeRead added in v0.0.13

func SaveWeRead(creds weread.Credentials) error

SaveWeRead writes creds through a temporary file and a rename, so a concurrent reader (such as another MCP call) never sees a partial file.

func SessionPath

func SessionPath() string

func WeReadPath added in v0.0.13

func WeReadPath() string

WeReadPath is where WeRead credentials are saved.

func WeReadSaver added in v0.0.13

func WeReadSaver(expected weread.Credentials) func(weread.Credentials) error

WeReadSaver only updates the login it loaded. Logout and replacement logins invalidate pending updates in this process.

Types

type Config

type Config struct {
	Theme          string `json:"theme,omitempty"`
	LastLoginEmail string `json:"last_login_email,omitempty"`
	// UserMirrors are HTTPS origins the user trusts with their login in
	// addition to the built-in Z-Library domains.
	UserMirrors []string `json:"user_mirrors,omitempty"`
}

Config stores global CLI preferences.

func LoadConfig

func LoadConfig() (Config, error)

type Session

type Session struct {
	Cookies map[string]string `json:"cookies"`
	Domain  string            `json:"domain"`
	Mode    string            `json:"mode,omitempty"`
}

func LoadSession

func LoadSession() (Session, error)

Jump to

Keyboard shortcuts

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