Beispiel #1
0
// Load optional logbase configuration file parameters.
func LoadConfig(path string) (config *LogbaseConfiguration, err error) {
	config = DefaultConfig()
	_, err = os.Stat(path)
	if os.IsNotExist(err) {
		err = nil
		return
	}
	if err != nil {
		return
	}
	_, err = toml.DecodeFile(path, &config)
	return
}
Beispiel #2
0
// Load optional server configuration file parameters.
func LoadServerConfig(path string) (config *ServerConfiguration, err error) {
	_, err = os.Stat(path)
	if os.IsNotExist(err) {
		config = DefaultServerConfig()
		err = nil
		return
	}
	if err != nil {
		return
	}
	config = new(ServerConfiguration)
	_, err = toml.DecodeFile(path, &config)
	return
}