Documentation ¶
Index ¶
- Variables
- func GenerateDefaultAnswerFile() error
- func ReadAnswerFile(answerFile string, conf *Config) error
- func ValidateConfig(conf Config) (errors []error)
- type Config
- type General
- type Icinga2
- type Wizard
- func (w *Wizard) AddBoolVar(callback *bool, name string, defaultValue bool, usage string, ...)
- func (w *Wizard) AddIcingaEndpoints(callback *[]icingaapi.Endpoint, name, usage string, dependency func() bool)
- func (w *Wizard) AddSliceVarFromString(callback *[]string, name string, defaultValue []string, usage string, ...)
- func (w *Wizard) AddStringSliceVar(callback *[]string, name string, defaultValue bool, initialPrompt string, ...)
- func (w *Wizard) AddStringVar(callback *string, name, defaultValue, usage string, required bool, ...)
- func (w *Wizard) Parse(availableModules string)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ModulesOrder = []string{
"ansible",
"base",
"corosync",
"elastic",
"foreman",
"grafana",
"graphite",
"graylog",
"icinga-director",
"icinga2",
"icingadb",
"icingaweb2",
"influxdb",
"keepalived",
"mongodb",
"mysql",
"postgresql",
"prometheus",
"puppet",
"redis",
"webservers",
}
)
Functions ¶
func GenerateDefaultAnswerFile ¶
func GenerateDefaultAnswerFile() error
GenerateDefaultAnswerFile creates a new answer-file with default values in current dir
func ReadAnswerFile ¶
ReadAnswerFile reads given values from answerFile and returns new Config
func ValidateConfig ¶
ValidateConfig validates the given config.Config for errors. Returns []error
Types ¶
type Config ¶
type Config struct { General General `yaml:"general" json:"general"` Icinga2 Icinga2 `yaml:"icinga2" json:"icinga2"` }
func GetControlDefaultObject ¶
func GetControlDefaultObject() Config
GetControlDefaultObject returns a new Config object with some pre-defined default values
type General ¶
type General struct { OutputFile string `yaml:"outputFile" json:"outputFile"` AnswerFile string `yaml:"answerFile,omitempty" json:"answerFile,omitempty"` EnabledModules []string `yaml:"enabledModules" json:"enabledModules"` DisabledModules []string `yaml:"disabledModules" json:"disabledModules"` ExtraObfuscators []string `yaml:"extraObfuscators" json:"extraObfuscators"` DetailedCollection bool `yaml:"detailedCollection" json:"detailedCollection"` CommandTimeout time.Duration `yaml:"commandTimeout" json:"commandTimeout"` }
type Wizard ¶
func (*Wizard) AddBoolVar ¶
func (w *Wizard) AddBoolVar(callback *bool, name string, defaultValue bool, usage string, dependency func() bool)
AddBoolVar adds argument for a boolean variable
callback: Variable to save the input to name: Internal name defaultValue: Default usage: usage string dependency: Add dependency function to validate if that argument will be added or not
func (*Wizard) AddIcingaEndpoints ¶
func (*Wizard) AddSliceVarFromString ¶
func (w *Wizard) AddSliceVarFromString(callback *[]string, name string, defaultValue []string, usage string, required bool, dependency func() bool)
AddSliceVarFromString reads a single string from stdin. This string will be separated by ',' and the resulting slice will be returned
callback: Variable to save the input to name: Internal name defaultValue: Default usage: usage string required: bool dependency: Add dependency function to validate if that argument will be added or not
func (*Wizard) AddStringSliceVar ¶
func (w *Wizard) AddStringSliceVar(callback *[]string, name string, defaultValue bool, initialPrompt string, inputPrompt string, dependency func() bool)
AddStringSliceVar adds argument for a slice of strings.
callback: Variable to save the input to name: Internal name defaultValue: Should that slice be collected via default? initialPrompt: The initial stdout message to ask if you want to collect inputPrompt: The recurring stdout message for each slice dependency: Add dependency function to validate if that argument will be added or not
func (*Wizard) AddStringVar ¶
func (w *Wizard) AddStringVar(callback *string, name, defaultValue, usage string, required bool, dependency func() bool)
AddStringVar adds argument for a string variable
callback: Variable to save the input to name: Internal name defaultValue: Default usage: usage string required: bool dependency: Add dependency function to validate if that argument will be added or not
Click to show internal directories.
Click to hide internal directories.