Documentation
¶
Index ¶
Constants ¶
View Source
const URLTagLength = 8
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
Base
Talkgroup *talkgroups.Talkgroup
TGName string
Score trending.Score[talkgroups.ID]
Context []TxCtx
}
Alert is a fat Alert record for rendering using notify templates.
func Make ¶
func Make(ctx context.Context, score trending.Score[talkgroups.ID], origScore float64) (Alert, error)
Make creates an alert for later rendering or storage.
func (*Alert) ComputeContextRange ¶
func (a *Alert) ComputeContextRange()
type Base ¶
type Base struct {
ID int `json:"-"`
Timestamp time.Time `json:"timestamp"`
TGID talkgroups.ID `json:"tg"`
OrigScore float64 `json:"origScore,omitzero"`
Weight float32 `json:"weight"`
Suppressed bool `json:"suppressed,omitzero"`
ContextWindow *common.TimeRange `json:"contextWindow,omitempty"`
URLTag *string `json:"urlTag,omitempty"`
}
func (*Base) GetResourceName ¶
type RenderedAlertBatch ¶
type RenderedAlertBatch struct {
Alerts []RenderedAlert
TopIdx int
TopScore float64
}
func (*RenderedAlertBatch) Top ¶
func (r *RenderedAlertBatch) Top() *RenderedAlert
Click to show internal directories.
Click to hide internal directories.