mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
28 lines
563 B
Go
28 lines
563 B
Go
package bamboohr
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/olebedev/config"
|
|
"github.com/wtfutil/wtf/cfg"
|
|
)
|
|
|
|
type Settings struct {
|
|
Common *cfg.Common
|
|
|
|
APIKey string
|
|
Subdomain string
|
|
}
|
|
|
|
func NewSettingsFromYAML(ymlConfig *config.Config) *Settings {
|
|
localConfig, _ := ymlConfig.Get("wtf.mods.bamboohr")
|
|
|
|
settings := Settings{
|
|
Common: cfg.NewCommonSettingsFromYAML(ymlConfig),
|
|
APIKey: localConfig.UString("apiKey", os.Getenv("WTF_BAMBOO_HR_TOKEN")),
|
|
Subdomain: localConfig.UString("subdomain", os.Getenv("WTF_BAMBOO_HR_SUBDOMAIN")),
|
|
}
|
|
|
|
return &settings
|
|
}
|