Documentation
¶
Overview ¶
Package config resolves the on-disk locations and runtime settings used by the bob-mdict service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// DictionaryDir is scanned recursively for .mdx files.
DictionaryDir string
// CacheDir holds transcoded audio and other derived artifacts.
CacheDir string
// Port is the loopback TCP port to listen on.
Port int
// Debug enables verbose logging and the debug lookup fields.
Debug bool
// SupportDir holds files the service maintains for itself, such as the
// helper that turns dictionary links into Bob lookups. Empty disables
// anything that needs it.
SupportDir string
}
Config holds everything the service needs to start.
func Default ¶
func Default() Config
Default builds a Config from environment overrides, falling back to the standard macOS Application Support layout.
func (Config) EnsureDirs ¶
EnsureDirs creates the dictionary and cache directories if they are missing, so a fresh install has somewhere for the user to drop dictionaries.