Documentation ¶
Index ¶
- func BuildClientsMetrics(clients *[]interface{}) *structs.StatusMetrics
- func BuildEventsMetrics(events *[]interface{}) *structs.StatusMetrics
- func GetBoolFromInterface(i interface{}) (bool, error)
- func GetEvent(check, client, dc string, events *[]interface{}) (map[string]interface{}, error)
- func GetIP(r *http.Request) string
- func GetInterfacesFromBytes(bytes []byte) ([]interface{}, error)
- func GetMapFromBytes(bytes []byte) (map[string]interface{}, error)
- func GetMapFromInterface(i interface{}) map[string]interface{}
- func InterfaceToSlice(slice interface{}) ([]interface{}, error)
- func InterfaceToString(i []interface{}) []string
- func IsCheckSilenced(check, client map[string]interface{}, dc string, silenced []interface{}) (bool, []string)
- func IsClientSilenced(client, dc string, silenced []interface{}) bool
- func IsStringInArray(item string, array []string) bool
- func RandomString(length int) string
- func StringInSlice(a string, list []string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildClientsMetrics ¶
func BuildClientsMetrics(clients *[]interface{}) *structs.StatusMetrics
BuildClientsMetrics builds the metrics for the events
func BuildEventsMetrics ¶
func BuildEventsMetrics(events *[]interface{}) *structs.StatusMetrics
BuildEventsMetrics builds the metrics for the events
func GetBoolFromInterface ¶
GetBoolFromInterface ...
func GetInterfacesFromBytes ¶
GetInterfacesFromBytes returns a slice of interfaces from a slice of byte
func GetMapFromBytes ¶
GetMapFromBytes returns a map from a slice of byte
func GetMapFromInterface ¶
func GetMapFromInterface(i interface{}) map[string]interface{}
GetMapFromInterface returns a map from an interface
func InterfaceToSlice ¶
func InterfaceToSlice(slice interface{}) ([]interface{}, error)
InterfaceToSlice takes a slice of type interface{} and returns a slice of interface
func InterfaceToString ¶
func InterfaceToString(i []interface{}) []string
InterfaceToString takes a slice of interface{} a slice of string
func IsCheckSilenced ¶
func IsCheckSilenced(check, client map[string]interface{}, dc string, silenced []interface{}) (bool, []string)
IsCheckSilenced determines whether a check for a particular client is silenced. Returns true if the check is silenced and a slice of silence entries IDs
func IsClientSilenced ¶
IsClientSilenced determines whether a client is silenced. Returns true if the client is silenced.
func IsStringInArray ¶
IsStringInArray searches 'array' for 'item' string Returns true 'item' is a value of 'array'
func RandomString ¶
RandomString generates a random string of the provided length
func StringInSlice ¶
return true if String in Slice, false otherwise
Types ¶
This section is empty.