notify

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package notify sends webhook notifications when findings cross severity thresholds.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericFinding

type GenericFinding struct {
	NotAfter  time.Time        `json:"notAfter"`
	Name      string           `json:"name"`
	Namespace string           `json:"namespace"`
	Source    store.SourceKind `json:"source"`
	Severity  store.Severity   `json:"severity"`
	ProbeOK   bool             `json:"probeOk"`
}

GenericFinding is a single finding in the generic webhook payload.

type GenericPayload

type GenericPayload struct {
	Timestamp time.Time        `json:"timestamp"`
	Summary   string           `json:"summary"`
	Findings  []GenericFinding `json:"findings"`
}

GenericPayload is the JSON body sent to generic webhooks.

type Notifier

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

Notifier sends alerts for findings that cross severity thresholds.

func New

New creates a Notifier from notification config. Returns nil if not enabled or no webhooks.

func (*Notifier) Notify

func (n *Notifier) Notify(prev, curr store.Snapshot)

Notify compares prev and curr snapshots and sends notifications for new or escalated findings.

type SlackBlock

type SlackBlock struct {
	Text *SlackText `json:"text,omitempty"`
	Type string     `json:"type"`
}

SlackBlock is a Slack Block Kit block.

type SlackPayload

type SlackPayload struct {
	Blocks []SlackBlock `json:"blocks"`
}

SlackPayload is the JSON body sent to Slack incoming webhooks.

type SlackText

type SlackText struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

SlackText is a Slack text element.

Jump to

Keyboard shortcuts

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