1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
wtf/modules/gspreadsheets/settings.go
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

43 lines
885 B
Go

package gspreadsheets
import (
"github.com/olebedev/config"
"github.com/wtfutil/wtf/cfg"
)
const (
defaultFocusable = false
defaultTitle = "Google Spreadsheets"
)
type colors struct {
values string
}
type Settings struct {
colors
*cfg.Common
cellAddresses []interface{}
cellNames []interface{}
secretFile string
sheetID string
}
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
settings := Settings{
Common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
cellNames: ymlConfig.UList("cells.names"),
secretFile: ymlConfig.UString("secretFile"),
sheetID: ymlConfig.UString("sheetId"),
}
settings.colors.values = ymlConfig.UString("colors.values", "green")
settings.SetDocumentationPath("google/spreadsheet")
return &settings
}