package config import "os" type Database struct { Address string `json:"address" yaml:"address"` Username string `json:"username" yaml:"username"` Password string `json:"password" yaml:"password"` Database string `json:"database" yaml:"database"` } type Avatar struct { Dirname string `json:"dirname" yaml:"dirname"` } type Config struct { Database Database `json:"database" yaml:"database"` Avatar Avatar `json:"avatar" yaml:"avatar"` AdminUsers []string `json:"admin_users" yaml:"adminUsers"` } func New() *Config { cfg := &Config{} cfg.Avatar.Dirname = os.TempDir() return cfg }