configuration

package
v1.0.52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncryptConfigFile

func EncryptConfigFile(filePath string) error

EncryptConfigFile will encrypt all the passwords in the full file.

func ReloadConfig added in v1.0.51

func ReloadConfig()

ReloadConfig pulls the config in again, useful for making changes to a running service.

Types

type Config

type Config struct {
	// Debug
	Debug      bool
	Copyrights bool
	Quiet      bool
	Version    bool
	ConfigTest bool

	// Config
	ConfigFile       string
	EncryptPasswords bool
	EncryptKey       string

	// Collector Settings
	Concurrency int
	Interval    time.Duration
	Timeout     time.Duration
	Daemonize   bool

	// Git
	GitPush       bool
	GitAuth       bool
	GitUser       string
	GitPrivateKey string

	// User Settings
	Workspace string
	RunResult string

	// Mail
	EmailEnabled bool
	EmailTo      string
	EmailFrom    string
	EmailSubject string

	// SMTP Plain Auth
	SMTPHost string
	SMTPPort int
	SMTPUser string
	SMTPPass string

	// Devices
	Devices []DeviceConfig
}

Config holds the general application settings.

func GetConfig

func GetConfig() *Config

GetConfig is concurrency safe loading and retrieving of the config data.

type DeviceConfig

type DeviceConfig struct {
	Name string
	Host string
	Type string
	User string
	Pass string
	// UnlockPass is used to access xtd-cli-mode on certain hp/comware devices, or enable for Cisco/etc..
	UnlockPass string
	Port       int
	Ciphers    string
	Disabled   bool
	// Channel to track device collection failures
	FailChan chan bool
	// Number of failures to trigger an alert. A value of 0 disables alerts
	FailureWarning int
	// SSH settings
	SSHTimeout       time.Duration
	SSHAuthMethod    string
	SSHPrivateKey    string
	AllowInsecureSSH bool
}

DeviceConfig holds the device specific settings.

func (DeviceConfig) GetName

func (d DeviceConfig) GetName() string

GetName provides a simple implementation for the Collector interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL