notifications

package
v0.0.0-...-33929cd Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: Apache-2.0 Imports: 15 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}"
)

Variables

This section is empty.

Functions

func ReplacePlaceholders

func ReplacePlaceholders(msg string, name string, kind string, namespace string, err string, attackTime time.Time) 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() 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