alerts

package
v0.23.4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertLog

type AlertLog struct {
	Project  string          `json:"project"`
	Data     json.RawMessage `json:"data"`
	Template string          `json:"template"`
	Labels   json.RawMessage `json:"labels"`
	Endpoint string          `json:"endpoint"`
	Status   string          `json:"status"`
	Message  string          `json:"message"`
}

AlertLog represents the structure received from the alert system

type AlertRepository

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

AlertRepository provides methods to interact with the alerts table

func NewAlertRepository

func NewAlertRepository(db *pgxpool.Pool) *AlertRepository

NewAlertRepository creates a new instance of AlertRepository

func (*AlertRepository) Insert

func (r *AlertRepository) Insert(ctx context.Context, alertPayload *alertmanager.AlertPayload) (uuid.UUID, error)

Insert logs an alert payload into the database

func (*AlertRepository) UpdateStatus

func (r *AlertRepository) UpdateStatus(ctx context.Context, id uuid.UUID, status alertmanager.AlertStatus, message string) error

UpdateStatus updates the alert status and optionally logs an error message

Jump to

Keyboard shortcuts

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