Documentation
¶
Index ¶
- Constants
- Variables
- func AuthPath() (string, error)
- func ConfigPath() (string, error)
- func DeviceUUIDPath() (string, error)
- func Dir() (string, error)
- func EnsureDir() (string, error)
- func SaveFile(path string, s Settings) error
- func TagTaxonomyPath(zone string) (string, error)
- func ValidateHost(host string) error
- type Runtime
- type Settings
Constants ¶
View Source
const ( HostMirror = "mirror" HostMain = "main" )
Host names accepted by --host / config.
View Source
const AppDirName = ".javdb-cli"
AppDirName is the directory under the user home used for credentials/config.
Variables ¶
View Source
var HostURLs = map[string]string{ HostMirror: "https://jdforrepam.com", HostMain: "https://javdb.com", }
HostURLs maps logical host names to base URLs.
Functions ¶
func ConfigPath ¶
func DeviceUUIDPath ¶
func TagTaxonomyPath ¶
func ValidateHost ¶
ValidateHost returns error if host is not a known name or absolute URL.
Types ¶
type Runtime ¶
type Runtime struct {
Host string // mirror | main
BaseURL string
Proxy string
AutoRelogin bool
Lang string
DeviceUUID string
}
Runtime is the resolved config after flag > env > file > default.
type Settings ¶
type Settings struct {
Host string `toml:"host"`
HTTPSProxy string `toml:"https_proxy,omitempty"`
AutoRelogin bool `toml:"auto_relogin"`
Lang string `toml:"lang,omitempty"`
DeviceUUID string `toml:"device_uuid,omitempty"` // optional override; else file/device_uuid
}
Settings is the on-disk config.toml schema.
Click to show internal directories.
Click to hide internal directories.