graphicek/server/integrations/integrations.go

30 lines
777 B
Go
Raw Normal View History

2024-03-29 09:55:51 +01:00
package integrations
2024-03-29 20:49:08 +01:00
import "basic-sensor-receiver/models"
2024-03-29 09:55:51 +01:00
type ContactPointMessageType string
const (
ContactPointEventAlertTriggered = "alert_triggered"
ContactPointEventTest = "test"
)
type ContactPointEvent struct {
Type ContactPointMessageType
AlertTriggeredEvent *ContactPointAlertTriggeredEvent
}
type ContactPointAlertTriggeredEvent struct {
2024-03-29 20:49:08 +01:00
Alert *models.AlertItem
Sensor *models.SensorItem
SensorValueCondition *models.AlertConditionSensorValue
SensorLastContactCondition *models.AlertConditionSensorLastContact
LastValue float64
2024-03-29 09:55:51 +01:00
}
type ContactPointIntegration interface {
ProcessEvent(evt *ContactPointEvent, rawConfig string) error
ValidateConfig(rawConfig string) error
}