Threshold structure

This commit is contained in:
DanB
2017-09-28 13:07:36 +02:00
parent b81914629e
commit aef49598a5
3 changed files with 21 additions and 2 deletions

View File

@@ -41,3 +41,22 @@ type ThresholdProfile struct {
func (tp *ThresholdProfile) TenantID() string {
return utils.ConcatenatedKey(tp.Tenant, tp.ID)
}
// ThresholdEvent is an event processed by ThresholdService
type ThresholdEvent struct {
Tenant string
ID string
Fields map[string]interface{}
}
// Threshold is the unit matched by filters
// It's WakeupTime is stored on demand
type Threshold struct {
Tenant string
ID string
LastExecuted time.Time
WakeupTime time.Time // prevent threshold to run too early
tPrfl *ThresholdProfile
dirty *bool // needs save
}