Documentation
¶
Overview ¶
Package config handles reading and writing the Hardcover CLI configuration file (a JSON document containing the API token).
Index ¶
Constants ¶
View Source
const EnvVar = "HARDCOVER_TOKEN"
EnvVar is the fallback environment variable for the API token.
View Source
const FileName = ".hardcover.json"
FileName is the file used in the user's home directory.
Variables ¶
This section is empty.
Functions ¶
func DeleteView ¶ added in v0.2.0
func LoadToken ¶
LoadToken returns the API token from the config file, or the HARDCOVER_TOKEN env var as a fallback. Returns errs.ErrNoToken (wrapped) if neither yields a value.
func PromptToken ¶
PromptToken reads a token from the terminal with echo disabled, falling back to plain read if the terminal doesn't support raw mode.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.