graphicek/server/integrations/integrations.go

30 lines
777 B
Go

package integrations
import "basic-sensor-receiver/models"
type ContactPointMessageType string
const (
ContactPointEventAlertTriggered = "alert_triggered"
ContactPointEventTest = "test"
)
type ContactPointEvent struct {
Type ContactPointMessageType
AlertTriggeredEvent *ContactPointAlertTriggeredEvent
}
type ContactPointAlertTriggeredEvent struct {
Alert *models.AlertItem
Sensor *models.SensorItem
SensorValueCondition *models.AlertConditionSensorValue
SensorLastContactCondition *models.AlertConditionSensorLastContact
LastValue float64
}
type ContactPointIntegration interface {
ProcessEvent(evt *ContactPointEvent, rawConfig string) error
ValidateConfig(rawConfig string) error
}