Documentation
¶
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetNames() []string
- func RunCollectors(Opts *SweetOptions)
- type Cisco
- type Collector
- type ConfigDiff
- type DeviceConfig
- type DeviceStatus
- type DeviceStatusState
- type External
- type JunOS
- type SSHCollector
- type Status
- type SweetOptions
- type WebReport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/
foo.txt
img/
a.png
b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
Types ¶
type Collector ¶
type Collector interface {
Collect(device DeviceConfig) (map[string]string, error)
}
type DeviceConfig ¶
type DeviceConfig struct {
Hostname string
Method string
Target string
Timeout time.Duration
CommandTimeout time.Duration
Config map[string]string
}
DeviceAccess stores host access info
type DeviceStatus ¶
type DeviceStatus struct {
Device DeviceConfig
State DeviceStatusState
When time.Time
Configs map[string]string
Diffs map[string]ConfigDiff
ErrorMessage string
}
type DeviceStatusState ¶
type DeviceStatusState int
const ( StatePending DeviceStatusState = iota StateError StateTimeout StateSuccess )
type SSHCollector ¶
type Status ¶
type Status struct {
Status map[string]DeviceStatus
Lock sync.Mutex
}
func (*Status) Get ¶
func (s *Status) Get(device string) DeviceStatus
func (*Status) GetAll ¶
func (s *Status) GetAll() map[string]DeviceStatus
func (*Status) Set ¶
func (s *Status) Set(stat DeviceStatus)
type SweetOptions ¶
type SweetOptions struct {
Interval time.Duration
Timeout time.Duration
GitPush bool
Insecure bool
Concurrency int
HttpListen string
HttpEnabled bool
SmtpString string
Workspace string
ExecutableDir string
ToEmail string
FromEmail string
UseSyslog bool
DefaultUser string
DefaultPass string
DefaultMethod string
Syslog *syslog.Writer
Devices []DeviceConfig
Status *Status
}
func (*SweetOptions) LogChanges ¶
func (Opts *SweetOptions) LogChanges(message string)
func (*SweetOptions) LogErr ¶
func (Opts *SweetOptions) LogErr(message string)
func (*SweetOptions) LogFatal ¶
func (Opts *SweetOptions) LogFatal(message string)
// logging convenience methods
func (*SweetOptions) LogInfo ¶
func (Opts *SweetOptions) LogInfo(message string)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.