sensugo

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const FullValidConfigForTesting = `` /* 202-byte string literal not displayed */

FullValidConfigForTesting is a string representation of a JSON object that contains all fields supported by the notifier Config. It can be used without secrets.

View Source
const FullValidSecretsForTesting = `{
	"apikey": "test-secret-api-key"
}`

FullValidSecretsForTesting is a string representation of JSON object that contains all fields that can be overridden from secrets

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL       string `json:"url,omitempty" yaml:"url,omitempty"`
	Entity    string `json:"entity,omitempty" yaml:"entity,omitempty"`
	Check     string `json:"check,omitempty" yaml:"check,omitempty"`
	Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	Handler   string `json:"handler,omitempty" yaml:"handler,omitempty"`
	APIKey    string `json:"apikey,omitempty" yaml:"apikey,omitempty"`
	Message   string `json:"message,omitempty" yaml:"message,omitempty"`
}

func NewConfig

func NewConfig(jsonData json.RawMessage, decryptFn receivers.DecryptFunc) (Config, error)

type Notifier

type Notifier struct {
	*receivers.Base
	// contains filtered or unexported fields
}

func New

func New(cfg Config, meta receivers.Metadata, template *templates.Template, sender receivers.WebhookSender, images images.Provider, logger logging.Logger) *Notifier

New is the constructor for the SensuGo notifier

func (*Notifier) Notify

func (sn *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error)

Notify sends an alert notification to Sensu Go

func (*Notifier) SendResolved

func (sn *Notifier) SendResolved() bool

Jump to

Keyboard shortcuts

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