custom

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertProvider

type AlertProvider struct {
	URL      string            `yaml:"url"`
	Method   string            `yaml:"method,omitempty"`
	Insecure bool              `yaml:"insecure,omitempty"`
	Body     string            `yaml:"body,omitempty"`
	Headers  map[string]string `yaml:"headers,omitempty"`
}

AlertProvider is the configuration necessary for sending an alert using a custom HTTP request Technically, all alert providers should be reachable using the custom alert provider

func (*AlertProvider) IsValid

func (provider *AlertProvider) IsValid() bool

IsValid returns whether the provider's configuration is valid

func (*AlertProvider) Send

func (provider *AlertProvider) Send(serviceName, alertDescription string, resolved bool) ([]byte, error)

Send a request to the alert provider and return the body

func (*AlertProvider) ToCustomAlertProvider added in v1.0.1

func (provider *AlertProvider) ToCustomAlertProvider(service *core.Service, alert *core.Alert, result *core.Result, resolved bool) *AlertProvider

ToCustomAlertProvider converts the provider into a custom.AlertProvider

Jump to

Keyboard shortcuts

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