mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
43 lines
885 B
Go
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
|
|
}
|