common

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LetterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

	TypeSlack     = "slack"
	TypeEmail     = "email"
	TypePagerDuty = "pagerduty" // # of letter indices fitting in 63 bits
)

Variables

This section is empty.

Functions

func CreateNameStub

func CreateNameStub(cm *corev1.ConfigMap) string

func GetConfig

func GetConfig() (*rest.Config, error)

GetConfig returns a Kubernetes config

func IsAlertEqual

func IsAlertEqual(rule rulefmt.RuleNode, grafanaRule grafana_alerts.GrafanaAlertRule) bool

IsAlertEqual compares two AlertRule objects for equality.

func ParseDuration

func ParseDuration(durationStr string) (int64, error)

ParseDuration turns a duration string (example: 5m, 1h) into an int64 value

Types

type Config

type Config struct {
	RulesAnnotation        string
	AlertManagerAnnotation string
	LogzioAPIToken         string
	LogzioAPIURL           string
	RulesDS                string
	EnvID                  string
	WorkerCount            int
	IgnoreSlackText        bool
	IgnoreSlackTitle       bool
}

Config holds all the configuration needed for the application to run.

func NewConfig

func NewConfig() *Config

NewConfig creates a Config struct, populating it with values from command-line flags and environment variables.

Jump to

Keyboard shortcuts

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