Documentation ¶
Index ¶
- Variables
- func Checksum(s string) string
- func ChunkKeys(done <-chan struct{}, keys []string, size int) <-chan []string
- func DecodeChecksum(c []byte) string
- func DecodeHexIfNotNil(hexStr interface{}) interface{}
- func DefaultIfNil(value, defaultValue interface{}) interface{}
- func Delta(a []string, b []string) ([]string, []string, []string)
- func EncodeChecksum(s string) []byte
- func IcingaStateTypeToString(stateType float32) string
- func JSONBooleanToDBBoolean(value interface{}) string
- func MillisecsToTime(millis float64) time.Time
- func NotificationStatesToBitMask(states []string) int
- func NotificationTypesToBitMask(types []string) int
- func RedisIntToDBBoolean(value interface{}) string
- func TimeToFloat(t time.Time) float64
- func TimeToMillisecs(t time.Time) int64
- type Benchmark
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Bool = map[bool]string{ // contains filtered or unexported fields } NotificationStatesToInt = map[string]int{ "OK": 1, "Warning": 2, "Critical": 4, "Unknown": 8, "Up": 16, "Down": 32, } NotificationTypesToInt = map[string]int{ "DowntimeStart": 1, "DowntimeEnd": 2, "DowntimeRemoved": 4, "Custom": 8, "Acknowledgement": 16, "Problem": 32, "Recovery": 64, "FlappingStart": 128, "FlappingEnd": 256, } NotificationTypesToDbEnumString = map[string]string{ "1": "downtime_start", "2": "downtime_end", "4": "downtime_removed", "8": "custom", "16": "acknowledgement", "32": "problem", "64": "recovery", "128": "flapping_start", "256": "flapping_end", } CommentEntryTypes = map[string]string{ "1": "comment", "4": "ack", } )
Functions ¶
func DecodeChecksum ¶
DecodeChecksum coverts a byte array into a hex string.
func DecodeHexIfNotNil ¶
func DecodeHexIfNotNil(hexStr interface{}) interface{}
DecodeHexIfNotNil converts a hex string to a byte array.
func DefaultIfNil ¶
func DefaultIfNil(value, defaultValue interface{}) interface{}
DefaultIfNil returns a defaultValue, if the given value is nil
func EncodeChecksum ¶
EncodeChecksum converts a hex string to a byte array.
func IcingaStateTypeToString ¶
func JSONBooleanToDBBoolean ¶
func JSONBooleanToDBBoolean(value interface{}) string
JSONBooleanToDBBoolean converts a boolean we got from Redis into a DB boolean.
func MillisecsToTime ¶
func NotificationStatesToBitMask ¶
NotificationStatesToBitMask converts an array of notification state strings into a bit mask.
func NotificationTypesToBitMask ¶
NotificationTypesToBitMask converts an array of notification type strings into a bit mask.
func RedisIntToDBBoolean ¶
func RedisIntToDBBoolean(value interface{}) string
func TimeToFloat ¶
func TimeToMillisecs ¶
TimeToMillisecs returns t as ms since *nix epoch.
Types ¶
Click to show internal directories.
Click to hide internal directories.