Documentation
¶
Overview ¶
Package serverconfig loads a kukeond ServerConfiguration document from disk. Used by `kukeond --configuration` (daemon root command) and `kuke init --server-configuration` to feed defaults into viper before the daemon starts. An absent file returns a zero-value document so the caller can fall back to its existing defaults without an error.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
func Load(path string) (*v1beta1.ServerConfigurationDoc, error)
Load reads path and returns the parsed ServerConfiguration. When the file does not exist, returns a zero-value document and no error — the absent case is normal (callers fall back to hardcoded defaults). Any other read or parse failure is wrapped with errdefs.ErrServerConfigurationInvalid.
func WriteDefault ¶
func WriteDefault(path string, spec v1beta1.ServerConfigurationSpec) (bool, error)
WriteDefault renders the commented default ServerConfiguration with the resolved spec the caller passes and writes it to path when the file is absent. Returns true only when this call created the file; an existing file (any contents) is left untouched, satisfying the "first-write only" rule. The spec's values are interpolated into the YAML so the on-disk document reflects the values the daemon actually started with, not a hardcoded snapshot of the compile-time defaults (issue #581). Creates the parent directory if missing. Any other failure is returned wrapped.
Types ¶
This section is empty.