notifications

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// header
	EnvVariableRegex = "^{\\$env:\\w+\\}$"

	// body (message)
	Name         = "{$name}"
	Kind         = "{$kind}"
	Namespace    = "{$namespace}"
	Timestamp    = "{$timestamp}"
	Time         = "{$time}"
	Date         = "{$date}"
	Error        = "{$error}"
	KubeMonkeyID = "{$kubemonkeyid}"
)

Variables

This section is empty.

Functions

func ReplacePlaceholders

func ReplacePlaceholders(msg string, name string, kind string, namespace string, err string, attackTime time.Time, kubeMonkeyID string) string

func ReportAttack

func ReportAttack(client Client, result *chaos.Result, time time.Time) bool

func ReportSchedule

func ReportSchedule(client Client, schedule *schedule.Schedule) bool

func Send

func Send(client Client, endpoint string, msg string, headers map[string]string) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func CreateClient

func CreateClient(proxy *string) Client

CreateClient creates a new client with a default timeout

func (Client) Request

func (c Client) Request(endpoint string, requestBody string, headers map[string]string) error

Request sends an http request and returns error also if response code is NOT 2XX

Jump to

Keyboard shortcuts

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