mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
30 lines
737 B
Go
30 lines
737 B
Go
package googleanalytics
|
|
|
|
import (
|
|
"github.com/olebedev/config"
|
|
"github.com/wtfutil/wtf/cfg"
|
|
)
|
|
|
|
const defaultTitle = "Google Analytics"
|
|
|
|
type Settings struct {
|
|
common *cfg.Common
|
|
|
|
months int
|
|
secretFile string `help:"Your Google client secret JSON file." values:"A string representing a file path to the JSON secret file."`
|
|
viewIds map[string]interface{}
|
|
}
|
|
|
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
|
|
|
settings := Settings{
|
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
|
|
|
months: ymlConfig.UInt("months"),
|
|
secretFile: ymlConfig.UString("secretFile"),
|
|
viewIds: ymlConfig.UMap("viewIds"),
|
|
}
|
|
|
|
return &settings
|
|
}
|