alerts

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	ID        string    `json:"id"`
	Type      string    `json:"type"`
	Entity    string    `json:"entity"`
	Message   string    `json:"message"`
	CreatedAt time.Time `json:"created_at"`
	Delivered bool      `json:"delivered"`
}

type AlertQueue

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

func NewAlertQueue

func NewAlertQueue(config CooldownConfig, handler func(*Alert) error) *AlertQueue

func (*AlertQueue) Enqueue

func (q *AlertQueue) Enqueue(alert *Alert) bool

func (*AlertQueue) PendingCount

func (q *AlertQueue) PendingCount() int

func (*AlertQueue) Start

func (q *AlertQueue) Start()

func (*AlertQueue) Stop

func (q *AlertQueue) Stop()

type CooldownConfig

type CooldownConfig struct {
	Period        time.Duration `json:"period"`
	MaxPending    int           `json:"max_pending"`
	DrainInterval time.Duration `json:"drain_interval"`
	SendDelay     time.Duration `json:"send_delay"`
}

func DefaultCooldownConfig

func DefaultCooldownConfig() CooldownConfig

Jump to

Keyboard shortcuts

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