Config provides access to read server configuration. Configuration backends that allow modifying configuration will also implement [ConfigWriter].
type Config interface { All(context.Context) (map[string]map[string]string, error) Section(context.Context, string) (map[string]string, error) Key(context.Context, string, string) (string, error) Reload(context.Context) error }
func Default() Config
Default returns a Config implementation which returns default values for all configuration options, and preserves changed settings only until restart.
func Map(conf map[string]map[string]string) Config
Map returns a Config implementation which returns the provided configuration.
Writer allows setting server configuration.
type Writer interface { // SetKey sets a new config value, and returns the old value. SetKey(context.Context, string, string, string) (string, error) Delete(context.Context, string, string) (string, error) }