Documentation ¶
Overview ¶
Package userconfig provides a simple way to manage client configuration. It reads and writes configuration to disk and provides a way to listen for changes.
Index ¶
Constants ¶
View Source
const ( DefaultConfigSaveDir = "" DefaultConfigFilename = "user.conf" )
Variables ¶
This section is empty.
Functions ¶
func OnConfigChange ¶
func OnConfigChange(fn func(old, new *UserConfig))
OnConfigChange registers a function to be called on config change. This allows callers to respond to each change without having to constantly poll for changes.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) GetConfig ¶
func (c *Config) GetConfig() *UserConfig
GetConfig implements services.ConfigHandler
func (*Config) SetConfig ¶
func (c *Config) SetConfig(new *UserConfig)
SetConfig implements services.ConfigHandler
type UserConfig ¶
type UserConfig = apipb.ConfigResponse
alias for better readability. Using "UserConfig" since "Config" and "ClientConfig" is already taken. This may change in the future if they become available.
Click to show internal directories.
Click to hide internal directories.