config

package
v2.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL