1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
Chris Cummer e195453573 Use explicit documentation paths for modules that are nested into subdirectories
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:18:46 -08:00

37 lines
942 B
Go

package googleanalytics
import (
"github.com/olebedev/config"
"github.com/wtfutil/wtf/cfg"
)
const (
defaultFocusable = false
defaultTitle = "Google Analytics"
)
type Settings struct {
*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{}
enableRealtime bool
}
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
settings := Settings{
Common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
months: ymlConfig.UInt("months"),
secretFile: ymlConfig.UString("secretFile"),
viewIds: ymlConfig.UMap("viewIds"),
enableRealtime: ymlConfig.UBool("enableRealtime", false),
}
settings.SetDocumentationPath("google/analytics")
return &settings
}