Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶
func NormalizeURL ¶
NormalizeURL takes a URL or protocol/host/port string and ensures a valid Zabbix JSON-RPC API endpoint URL. Examples: - "http://localhost:8080" -> "http://localhost:8080/api_jsonrpc.php" - "https://zabbix.example.com" -> "https://zabbix.example.com/api_jsonrpc.php" - "localhost:8080" -> "http://localhost:8080/api_jsonrpc.php" - "http://localhost:8080/zabbix" -> "http://localhost:8080/zabbix/api_jsonrpc.php" - "http://localhost:8080/zabbix/api_jsonrpc.php" -> "http://localhost:8080/zabbix/api_jsonrpc.php"
func SaveConfig ¶
Types ¶
type Config ¶
type Config struct {
ActiveContext string `mapstructure:"active_context" json:"active_context" yaml:"active_context"`
Contexts map[string]Context `mapstructure:"contexts" json:"contexts" yaml:"contexts"`
}
func DefaultConfig ¶
func DefaultConfig() *Config
func LoadConfig ¶
type Context ¶
type Context struct {
URL string `mapstructure:"url" json:"url" yaml:"url"`
APIToken string `mapstructure:"api_token,omitempty" json:"api_token,omitempty" yaml:"api_token,omitempty"`
Username string `mapstructure:"username,omitempty" json:"username,omitempty" yaml:"username,omitempty"`
Password string `mapstructure:"password,omitempty" json:"password,omitempty" yaml:"password,omitempty"`
HTTPUser string `mapstructure:"http_user,omitempty" json:"http_user,omitempty" yaml:"http_user,omitempty"`
HTTPPassword string `mapstructure:"http_password,omitempty" json:"http_password,omitempty" yaml:"http_password,omitempty"`
HTTPHeaders map[string]string `mapstructure:"http_headers,omitempty" json:"http_headers,omitempty" yaml:"http_headers,omitempty"`
TLSCertFile string `mapstructure:"tls_cert_file,omitempty" json:"tls_cert_file,omitempty" yaml:"tls_cert_file,omitempty"`
TLSKeyFile string `mapstructure:"tls_key_file,omitempty" json:"tls_key_file,omitempty" yaml:"tls_key_file,omitempty"`
TLSCAFile string `mapstructure:"tls_ca_file,omitempty" json:"tls_ca_file,omitempty" yaml:"tls_ca_file,omitempty"`
SafetyLevel string `mapstructure:"safety_level" json:"safety_level" yaml:"safety_level"`
OutputFormat string `mapstructure:"output_format" json:"output_format" yaml:"output_format"`
Timeout int `mapstructure:"timeout" json:"timeout" yaml:"timeout"`
InsecureSkipVerify bool `mapstructure:"insecure_skip_verify" json:"insecure_skip_verify" yaml:"insecure_skip_verify"`
}