helpers

package
v0.0.0-...-97a7976 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func GetBoolFromInterface(i interface{}) (bool, error)

GetBoolFromInterface ...

func GetEvent

func GetEvent(check, client, dc string, events *[]interface{}) (map[string]interface{}, error)

GetEvent returns an event associated to a specific check

func GetIP

func GetIP(r *http.Request) string

GetIP returns the real user IP address

func GetInterfacesFromBytes

func GetInterfacesFromBytes(bytes []byte) ([]interface{}, error)

GetInterfacesFromBytes returns a slice of interfaces from a slice of byte

func GetMapFromBytes

func GetMapFromBytes(bytes []byte) (map[string]interface{}, error)

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 IsAcknowledged

func IsAcknowledged(check, client, dc string, stashes []interface{}) bool

IsAcknowledged determines if a client or a check has an associated silence stash

func IsStringInArray

func IsStringInArray(item string, array []string) bool

IsStringInArray searches 'array' for 'item' string Returns true 'item' is a value of 'array'

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL