Documentation ¶
Overview ¶
TODO: Verificar se root_config.go é necessário
Index ¶
- Constants
- Variables
- func Confirm(message string, defaultValue bool) bool
- func Prompt(message string, defaultValue string) (value string, err error)
- func PromptPath(message string, defaultPath string) (value string, err error)
- func SetupConfigurationRoot(rootCommand *cobra.Command)
- type ConfigError
- type ConfigFolder
- type RootConfig
Constants ¶
View Source
const ( GSDEV_CONFIGURATION_ENV = "GSDEV_CONFIGURATION" NO_ERROR = 0 ERROR_MISSING_CONF_PATH = 1 ERROR_CONF_PATH_NOT_FOUND = 2 ERROR_CONF_FILE_NOT_FOUND = 3 ERROR_CONF_FILE_READ = 4 ERROR_CONF_FILE_INVALID = 5 ERROR_CONF_PATH_IO = 6 )
Variables ¶
View Source
var ConfigurationPath string
View Source
var DefaultConfigurationPath string
Functions ¶
func SetupConfigurationRoot ¶
Types ¶
type ConfigError ¶ added in v0.0.4
func (*ConfigError) SetErrorf ¶ added in v0.0.4
func (cfg *ConfigError) SetErrorf(errorCode int, format string, a ...interface{})
type ConfigFolder ¶ added in v0.0.4
type ConfigFolder struct { ConfigError `yaml:"-"` DataFolder string `yaml:"-"` }
func NewConfigFolder ¶ added in v0.0.4
func NewConfigFolder(cmd *cobra.Command) (cfg *ConfigFolder)
type RootConfig ¶
type RootConfig struct { DataFolder string `yaml:"-"` ConfigFile string `yaml:"-"` ErrorCode int `yaml:"-"` Error string `yaml:"-"` }
func ValidateConfiguration ¶
func ValidateConfiguration(cmd *cobra.Command) (cfg RootConfig)
func (*RootConfig) Prompt ¶
func (cfg *RootConfig) Prompt() bool
func (*RootConfig) ReadFile ¶
func (cfg *RootConfig) ReadFile(filename string) error
func (*RootConfig) SetErrorf ¶
func (cfg *RootConfig) SetErrorf(errorCode int, format string, a ...interface{})
func (*RootConfig) WriteFile ¶
func (cfg *RootConfig) WriteFile(filename string) error
Click to show internal directories.
Click to hide internal directories.