godoc'd the source

This commit is contained in:
2025-09-14 22:05:17 -06:00
parent c6391a456f
commit b10b4e93f2
7 changed files with 107 additions and 7 deletions
+8 -1
View File
@@ -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
}