Documentation
¶
Overview ¶
Package appconfig reads the current CLI and daemon's per-user configuration. Loading configuration never creates directories, scans USB or starts a service.
Index ¶
Constants ¶
const ( Filename = "config.yaml" MaxFileBytes = 1 << 20 DefaultTerminalLimit = 16384 DefaultTerminalTTL = 30 * time.Minute DefaultListen = daemonaddr.Listen )
Variables ¶
This section is empty.
Functions ¶
func DefaultBaseDir ¶
func Init ¶
Init explicitly creates a private configuration directory and a new 0600 example file. Existing files are never replaced; library directories are not created. Existing parent directory permissions are checked, never changed.
Types ¶
type Config ¶
type Config struct {
Device string `json:"device" yaml:"device"`
Server ServerConfig `json:"server" yaml:"server"`
Jobs JobConfig `json:"jobs" yaml:"jobs"`
LibraryDir string `json:"library_dir" yaml:"library_dir"`
}
type RemoteServerConfig ¶ added in v0.1.3
type RemoteServerConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
Listen string `json:"listen" yaml:"listen"`
Host string `json:"host,omitempty" yaml:"host,omitempty"`
TokenFile string `json:"token_file" yaml:"token_file"`
TLSCertFile string `json:"tls_cert_file" yaml:"tls_cert_file"`
TLSKeyFile string `json:"tls_key_file" yaml:"tls_key_file"`
}
RemoteServerConfig contains listener settings and paths to credentials. Load resolves relative credential paths beside the selected configuration file.
func (RemoteServerConfig) Validate ¶ added in v0.1.3
func (remote RemoteServerConfig) Validate() error
Validate checks enabled listener settings without opening files or sockets.
type Selection ¶
Selection separates the stable application storage root from the selected configuration file. Choosing another file does not relocate libraries or locks.
type ServerConfig ¶
type ServerConfig struct {
Devices []string `json:"devices" yaml:"devices"`
Listen string `json:"listen" yaml:"listen"`
DefaultDeviceFallback string `json:"default_device_fallback,omitempty" yaml:"default_device_fallback,omitempty"`
LocalTokenFile string `json:"local_token_file,omitempty" yaml:"local_token_file,omitempty"`
Remote *RemoteServerConfig `json:"remote,omitempty" yaml:"remote,omitempty"`
}