commons

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FillTemplate

func FillTemplate(object interface{}, tmpl template.Template) (*string, error)

FillTemplate is a boiler-plate function to fill a template

func GroupAlertsBy

func GroupAlertsBy(alerts []types.Alert, groupNameFunction types.GetAlertGroupName) (*map[string][]types.Alert, error)

GroupAlertsBy groups given alerts according to an ID

func GroupAlertsByLabel

func GroupAlertsByLabel(alerts []types.Alert, label string) (*map[string][]types.Alert, error)

GroupAlertsByLabel groups several alerts by a given label. If the label does not exists, then a "<none>" key is created

func GroupAlertsByName

func GroupAlertsByName(alerts []types.Alert) (*map[string][]types.Alert, error)

GroupAlertsByName groups several alerts by their names

func IndexOf

func IndexOf(element string, data []string) int

IndexOf returns the position of a given element in a string slice

func IsOID

func IsOID(text string) bool

IsOID checks if a given string is a valid OID

Types

This section is empty.

Jump to

Keyboard shortcuts

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