39 lines
1.6 KiB
Go
39 lines
1.6 KiB
Go
package local_event
|
|
|
|
import (
|
|
"time"
|
|
|
|
common "git.ilapage.cn/ila/yovision/Sense/server/common/models"
|
|
)
|
|
|
|
const (
|
|
CandidateStateCandidate = "candidate"
|
|
CandidateStateConfirmed = "confirmed"
|
|
|
|
EvidenceStatePending = "pending"
|
|
EvidenceStateSuccess = "success"
|
|
EvidenceStateFailed = "failed"
|
|
)
|
|
|
|
// EventCandidate is a Sense-internal, anonymous event candidate. It is not a
|
|
// cross-product event contract and does not represent a Bell alert.
|
|
type EventCandidate struct {
|
|
ID string `gorm:"size:36;primaryKey" json:"id"`
|
|
OccurredAt time.Time `gorm:"not null;index" json:"occurredAt"`
|
|
SourceRef string `gorm:"size:128;not null;index" json:"sourceRef"`
|
|
SourceLabel string `gorm:"size:128;not null;default:''" json:"sourceLabel"`
|
|
RuleRef string `gorm:"size:128;not null;index" json:"ruleRef"`
|
|
RuleName string `gorm:"size:128;not null" json:"ruleName"`
|
|
RuleVersion string `gorm:"size:64;not null;default:''" json:"ruleVersion"`
|
|
ZoneRef string `gorm:"size:128;not null;default:''" json:"zoneRef"`
|
|
CandidateState string `gorm:"size:32;not null;index" json:"candidateState"`
|
|
EvidenceState string `gorm:"size:32;not null;index" json:"evidenceState"`
|
|
EvidenceRef string `gorm:"size:512;not null;default:''" json:"evidenceRef,omitempty"`
|
|
EvidenceDetail string `gorm:"size:512;not null;default:''" json:"evidenceDetail,omitempty"`
|
|
RetainUntil time.Time `gorm:"not null;index" json:"retainUntil"`
|
|
common.ControlBy
|
|
common.ModelTime
|
|
}
|
|
|
|
func (EventCandidate) TableName() string { return "sense_local_event_candidates" }
|