alerts

package
v0.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(group *echo.Group, logger *zap.Logger, tsClient *timescaledb.Client)

Types

type Handler

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

func NewHandler

func NewHandler(logger *zap.Logger, tsClient *timescaledb.Client) *Handler

func (*Handler) GetAlerts

func (h *Handler) GetAlerts(c echo.Context) error

GetAlerts returns alerts based on water level thresholds @Summary Get alerts @Description Retrieve alerts based on configurable thresholds for a specific device. Organization is resolved from X-Organization header or hostname (e.g., {org}.localhost) @Tags alerts @Accept json @Produce json @Param device_id query string true "Device ID" @Param category query string true "Alert category (e.g., water_level)" @Param start_date query string true "Start date (YYYY-MM-DD format)" @Param end_date query string true "End date (YYYY-MM-DD format)" @Param caution_threshold query number false "Caution threshold value" @Param warning_threshold query number false "Warning threshold value" @Param critical_threshold query number false "Critical threshold value" @Param limit query int false "Number of results per page (default 20)" @Param offset query int false "Number of results to skip (default 0)" @Success 200 {object} common.PaginatedResponse @Failure 400 {object} map[string]string "Invalid request parameters" @Failure 500 {object} map[string]string "Internal server error" @Router /telemetry/v1/alerts [get]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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