Documentation
¶
Index ¶
- func ConfigPath() string
- func KindleConfigPath() string
- func LoadKindleConfig() (zlib.KindleConfig, error)
- func LoadKindleConfigFrom(path string) (zlib.KindleConfig, error)
- func LoadWeRead() (weread.Credentials, error)
- func RemoveWeRead() (bool, error)
- func SaveConfig(c Config) error
- func SaveKindleConfig(cfg zlib.KindleConfig) error
- func SaveKindleConfigTo(path string, cfg zlib.KindleConfig) error
- func SaveSession(s Session) error
- func SaveWeRead(creds weread.Credentials) error
- func SessionPath() string
- func WeReadPath() string
- func WeReadSaver(expected weread.Credentials) func(weread.Credentials) error
- type Config
- type Session
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
RemoveWeRead deletes the saved credentials and reports whether a file existed.
func SaveConfig ¶
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 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.