notify

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: GPL-2.0, GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package notify delivers knell's transition notifications to a Discord webhook. It is the only outbound-network code in the app: one POST per transition, retried on transient failures via httpx.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discord

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

Discord posts plain-content messages to one Discord-compatible webhook.

func New

func New(webhookURL, node string) *Discord

New builds a Discord notifier for the given webhook URL. node names this observer instance in every message so multi-node deployments read as distinct reports.

func (*Discord) BeatMissing

func (d *Discord) BeatMissing(ctx context.Context, id string, silence time.Duration) error

BeatMissing announces that a beat's deadline of silence has passed.

func (*Discord) BeatRecovered

func (d *Discord) BeatRecovered(ctx context.Context, id string, downFor time.Duration) error

BeatRecovered announces the first ping after a missing alert.

func (*Discord) Close

func (d *Discord) Close()

Close releases idle connections. Call once on shutdown.

Jump to

Keyboard shortcuts

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