-
Notifications
You must be signed in to change notification settings - Fork 14
/
types.go
34 lines (28 loc) · 948 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package collectors
// CollectorRunner returns inventory by calling run function of invetory collector
type CollectorRunner func() ([]byte, error)
// MetricRunner returns metric by calling run function of metric collector
type MetricRunner func() ([]*MetricResult, error)
// CollectorPrecheck is precheck function for metric or inventory collectors
type CollectorPrecheck func() error
// CollectorFnWrapper is wrapper struct for inventory collectors
type CollectorFnWrapper struct {
RunFn CollectorRunner
PrecheckFn CollectorPrecheck
Dependencies []string
Type string
}
// MetricFnWrapper is wrapper struct for metric collectors
type MetricFnWrapper struct {
RunFn MetricRunner
PrecheckFn CollectorPrecheck
Dependencies []string
Type string
}
// MetricResult represents a metric (example cpu)
type MetricResult struct {
Header string
Data string
Sufix string
Metadata map[string]string
}