1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

32 lines
608 B
Go

package ipapi
import (
"github.com/olebedev/config"
"github.com/wtfutil/wtf/cfg"
)
const configKey = "ipapi"
type colors struct {
name string
value string
}
type Settings struct {
colors
common *cfg.Common
}
func NewSettingsFromYAML(name string, ymlConfig *config.Config) *Settings {
localConfig, _ := ymlConfig.Get("wtf.mods." + configKey)
settings := Settings{
common: cfg.NewCommonSettingsFromYAML(name, configKey, ymlConfig),
}
settings.colors.name = localConfig.UString("colors.name", "red")
settings.colors.value = localConfig.UString("colors.value", "white")
return &settings
}