godoc'd the source
This commit is contained in:
+8
-1
@@ -6,6 +6,8 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
// Package config contains support for Amsterdam site-wide configuration data.
|
||||
package config
|
||||
|
||||
import (
|
||||
@@ -14,6 +16,7 @@ import (
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
// AmConfig holds the configuration of the application as read from YAML.
|
||||
type AmConfig struct {
|
||||
Site struct {
|
||||
Title string `yaml:"title"`
|
||||
@@ -23,10 +26,14 @@ type AmConfig struct {
|
||||
//go:embed default.yaml
|
||||
var defaultConfigData []byte
|
||||
|
||||
// GlobalConfig holds the global configuration.
|
||||
var GlobalConfig AmConfig
|
||||
|
||||
// init prepares the default configuration for the application.
|
||||
func init() {
|
||||
var defaultConfig AmConfig
|
||||
yaml.Unmarshal(defaultConfigData, &defaultConfig)
|
||||
if err := yaml.Unmarshal(defaultConfigData, &defaultConfig); err != nil {
|
||||
panic(err) // can't happen
|
||||
}
|
||||
GlobalConfig = defaultConfig
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user