dinding

package
v0.0.0-...-be61d61 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: AGPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const FullValidConfigForTesting = `` /* 211-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.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL         string `json:"url,omitempty" yaml:"url,omitempty"`
	MessageType string `json:"msgType,omitempty" yaml:"msgType,omitempty"`
	Title       string `json:"title,omitempty" yaml:"title,omitempty"`
	Message     string `json:"message,omitempty" yaml:"message,omitempty"`
}

func NewConfig

func NewConfig(jsonData json.RawMessage) (Config, error)

type Notifier

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

Notifier is responsible for sending alert notifications to ding ding.

func New

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

func (*Notifier) Notify

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

Notify sends the alert notification to dingding.

func (*Notifier) SendResolved

func (dd *Notifier) SendResolved() bool

Jump to

Keyboard shortcuts

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