mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
30 lines
544 B
Go
30 lines
544 B
Go
package ipapi
|
|
|
|
import (
|
|
"github.com/olebedev/config"
|
|
"github.com/wtfutil/wtf/cfg"
|
|
)
|
|
|
|
type colors struct {
|
|
name string
|
|
value string
|
|
}
|
|
|
|
type Settings struct {
|
|
colors
|
|
common *cfg.Common
|
|
}
|
|
|
|
func NewSettingsFromYAML(ymlConfig *config.Config) *Settings {
|
|
localConfig, _ := ymlConfig.Get("wtf.mods.ipapi")
|
|
|
|
settings := Settings{
|
|
common: cfg.NewCommonSettingsFromYAML(ymlConfig),
|
|
}
|
|
|
|
settings.colors.name = localConfig.UString("colors.name", "red")
|
|
settings.colors.value = localConfig.UString("colors.value", "white")
|
|
|
|
return &settings
|
|
}
|