view

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderHeartbeats

func RenderHeartbeats(
	w io.Writer,
	tmpl *template.Template,
	bumpURL string,
	mgr *heartbeat.Manager,
	hist history.Store,
) error

RenderHeartbeats builds HeartbeatView slice, sorts it, and executes the template.

func RenderHistory

func RenderHistory(
	w io.Writer,
	tmpl *template.Template,
	hist history.Store,
) error

RenderHistory sorts events newest-first, builds the filter list, and executes the template.

func RenderReceivers

func RenderReceivers(
	w io.Writer,
	tmpl *template.Template,
	disp *notifier.Dispatcher,
) error

RenderReceivers builds ReceiverView slice, sorts it by (ID,Type), and executes the template.

Types

type HeartbeatView

type HeartbeatView struct {
	ID              string
	Status          string
	Description     string
	Interval        string
	IntervalSeconds float64 // for table sorting
	Grace           string
	GraceSeconds    float64 // for table sorting
	LastBump        time.Time
	URL             string // full URL to copy
	Receivers       []string
	HasHistory      bool
}

type HistoryView

type HistoryView struct {
	Timestamp   time.Time
	Type        string // EventType
	HeartbeatID string
	Details     string // e.g. "Notification Sent", "old → new", or blank
}

HistoryView is what the template actually sees. Details is already formatted for display.

type ReceiverView

type ReceiverView struct {
	ID          string // receiver ID
	Type        string // "slack", "email", etc.
	Destination string // e.g. channel name, email addrs
	LastSent    time.Time
	LastErr     error
}

ReceiverView for rendering each notifier instance.

Jump to

Keyboard shortcuts

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