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
Click to show internal directories.
Click to hide internal directories.