Documentation ¶
Index ¶
- type DaemonConfig
- func (d *DaemonConfig) Dump() *types.DaemonConfig
- func (d *DaemonConfig) GetAddress() types.AddrPort
- func (d *DaemonConfig) GetName() string
- func (d *DaemonConfig) GetServers() map[string]types.ServerConfig
- func (d *DaemonConfig) Load() error
- func (d *DaemonConfig) SetAddress(address types.AddrPort)
- func (d *DaemonConfig) SetName(name string)
- func (d *DaemonConfig) SetServers(servers map[string]types.ServerConfig)
- func (d *DaemonConfig) Write() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DaemonConfig ¶
type DaemonConfig struct {
// contains filtered or unexported fields
}
DaemonConfig wraps the daemon's config with get, set and lock capabilities.
func NewDaemonConfig ¶
func NewDaemonConfig(path string) *DaemonConfig
NewDaemonConfig returns an initialised version of the daemon's config. The implementation is thread safe so the same in memory representation of the config can be consumed both internally in the daemon and it's API endpoints. The config has to be written to file proactively so when setting a config setting it doesn't automatically get propagated to the underlying file.
func (*DaemonConfig) Dump ¶
func (d *DaemonConfig) Dump() *types.DaemonConfig
Dump dumps the entire daemon's config.
func (*DaemonConfig) GetAddress ¶
func (d *DaemonConfig) GetAddress() types.AddrPort
GetAddress returns the daemon's address.
func (*DaemonConfig) GetName ¶
func (d *DaemonConfig) GetName() string
GetName returns the daemon's name.
func (*DaemonConfig) GetServers ¶
func (d *DaemonConfig) GetServers() map[string]types.ServerConfig
GetServers returns the daemon's additional listener configs.
func (*DaemonConfig) Load ¶
func (d *DaemonConfig) Load() error
Load loads the daemon's config from its path.
func (*DaemonConfig) SetAddress ¶
func (d *DaemonConfig) SetAddress(address types.AddrPort)
SetAddress sets the daemon's address.
func (*DaemonConfig) SetName ¶
func (d *DaemonConfig) SetName(name string)
SetName sets the daemon's name.
func (*DaemonConfig) SetServers ¶
func (d *DaemonConfig) SetServers(servers map[string]types.ServerConfig)
SetServers sets the daemon's additional listener configs.
func (*DaemonConfig) Write ¶
func (d *DaemonConfig) Write() error
Write writes the daemon's config to its path.