Documentation ¶
Overview ¶
Package sysdb declares core constants and types used by SysDB packages.
Index ¶
Constants ¶
const ( LogEmerg = LogPriority(0) LogErr = LogPriority(3) LogWarning = LogPriority(4) LogNotice = LogPriority(5) LogInfo = LogPriority(6) LogDebug = LogPriority(7) )
Log priorities supported by SysDB.
const ( Second = Duration(1000000000) Minute = 60 * Second Hour = 60 * Minute Day = 24 * Hour Month = Duration(30436875 * 24 * 60 * 60 * 1000) Year = Duration(3652425 * 24 * 60 * 60 * 100000) )
Common durations. All values greater than or equal to a day are not exact values but subject to daylight savings time changes, leap years, etc. They are available mostly for providing human readable display formats.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute struct { Name string `json:"name"` Value string `json:"value"` LastUpdate Time `json:"last_update"` UpdateInterval Duration `json:"update_interval"` Backends []string `json:"backends"` }
An Attribute describes a host, metric, or service attribute.
type Duration ¶
A Duration represents the elapsed time between two instants as a nanoseconds count.
It supports marshaling to and unmarshaling from the SysDB JSON format (a sequence of decimal numbers with a unit suffix).
func (Duration) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. The duration is a quoted string in the SysDB JSON format.
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. The duration is expected to be a quoted string in the SysDB JSON format.
type Host ¶
type Host struct { Name string `json:"name"` LastUpdate Time `json:"last_update"` UpdateInterval Duration `json:"update_interval"` Backends []string `json:"backends"` Attributes []Attribute `json:"attributes"` Metrics []Metric `json:"metrics"` Services []Service `json:"services"` }
A Host describes a host object stored in the SysDB store.
type Metric ¶
type Metric struct { Name string `json:"name"` Timeseries bool `json:"timeseries"` LastUpdate Time `json:"last_update"` UpdateInterval Duration `json:"update_interval"` Backends []string `json:"backends"` Attributes []Attribute `json:"attributes"` }
A Metric describes a metric known to SysDB.
type Service ¶
type Service struct { Name string `json:"name"` LastUpdate Time `json:"last_update"` UpdateInterval Duration `json:"update_interval"` Backends []string `json:"backends"` Attributes []Attribute `json:"attributes"` }
A Service describes a service object stored in the SysDB store.
type Time ¶
A Time represents an instant in time with nanosecond precision.
It supports marshaling to and unmarshaling from the SysDB JSON format (YYYY-MM-DD hh:mm:ss +-zzzz).
func (Time) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. The time is a quoted string in the SysDB JSON format.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. The time is expected to be a quoted string in the SysDB JSON format.