diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2021-09-10 12:47:19 +0200 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2021-09-10 12:47:19 +0200 |
commit | 7e72caa092194306ba6b5c6b58e6262fdd1fd72c (patch) | |
tree | a708f77cc188fb49b72dae608e100bb8ac0b4420 /config.go | |
parent | 04d33fd100b67da504b16d9f98baa255d5060028 (diff) |
Document exported code (#49)
Diffstat (limited to 'config.go')
-rw-r--r-- | config.go | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -8,12 +8,6 @@ import ( "sync" ) -const latestSerializeVer = 28 -const latestProtoVer = 39 -const maxPlayerNameLen = 20 -const playerNameChars = "^[a-zA-Z0-9-_]+$" -const bytesPerMediaBunch = 5000 - const defaultCmdPrefix = ">" const defaultSendInterval = 0.09 const defaultUserLimit = 10 @@ -23,6 +17,8 @@ const defaultBindAddr = ":40000" var config Config var configMu sync.RWMutex +// A Config contains information from the configuration file +// that affects the way the proxy works. type Config struct { NoPlugins bool CmdPrefix string @@ -48,6 +44,8 @@ type Config struct { UserGroups map[string]string } +// Conf returns a copy of the Config used by the proxy. +// Any modifications will not affect the original Config. func Conf() Config { configMu.RLock() defer configMu.RUnlock() @@ -55,6 +53,9 @@ func Conf() Config { return config } +// LoadConfig attempts to parse the configuration file. +// It leaves the config unchanged if there is an error +// and returns the error. func LoadConfig() error { configMu.Lock() defer configMu.Unlock() |