Documentation ¶
Overview ¶
Package conf handles configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct { MaxConfigFiles int Holdtime time.Duration ScanInterval time.Duration MaxConcurrency int MaxConfigLoadSize int64 LastChange Change Comment string // free user-defined field }
AppConfig is persistent global configuration.
func NewAppConfigFromString ¶
NewAppConfigFromString creates AppConfig from string.
type DevAttributes ¶
type DevAttributes struct { NeedLoginChat bool // need login chat NeedEnabledMode bool // need enabled mode NeedPagingOff bool // need disabled pager EnableCommand string // enable UsernamePromptPattern string // Username: PasswordPromptPattern string // Password: EnablePasswordPromptPattern string // Password: DisabledPromptPattern string // > EnabledPromptPattern string // # ("" --> look for EOF) CommandList []string // "show version", "show run" DisablePagerCommand string // term len 0 DisablePagerExtraPromptCount int // consume N extra prompts SupressAutoLF bool // do not send auto LF QuoteSentCommandsFormat string // !![%s] - empty means omitting KeepControlChars bool // enable if you want to capture control chars (backspace, etc) LineFilter string // line filter name - applied to every saved line ChangesOnly bool // save new file only if it differs from previous one S3ContentType string // ""=none "detect"=http.Detect "text/plain" etc RunProg []string // "/path/to/external/command", "arg1", "arg2" for the run model RunTimeout time.Duration // 60s - time allowed for external program to complete ErrlogHistSize int // max number of lines in errlog history PostLoginPromptPattern string // mikrotik: Please press "Enter" to continue! PostLoginPromptResponse string // mikrotik: \r\n UsernameAppend string // mikrotik: +cte // readTimeout: per-read timeout (protection against inactivity) // matchTimeout: full match timeout (protection against slow sender -- think 1 byte per second) ReadTimeout time.Duration // protection against inactivity MatchTimeout time.Duration // protection against slow sender SendTimeout time.Duration // protection against inactivity CommandReadTimeout time.Duration // larger timeout for slow responses (slow show running) CommandMatchTimeout time.Duration // larger timeout for slow responses (slow show running) }
DevAttributes is per-model set of default attributes for device.
type DevConfig ¶
type DevConfig struct { Debug bool Deleted bool Model string ID string HostPort string Transports string LoginUser string LoginPassword string EnablePassword string SSHClearCiphers bool SSHAddCiphers []string Comment string // free user-defined field LastChange Change Attr DevAttributes }
DevConfig is full set of device properties.
func NewDeviceFromString ¶
NewDeviceFromString creates device configuration from string.
Click to show internal directories.
Click to hide internal directories.