Versions in this module Expand all Collapse all v1 v1.0.0 Mar 25, 2026 Changes in this version + type Alert struct + Message string + Rule AlertRule + Timestamp time.Time + type AlertEngine struct + func NewAlertEngine(rules []AlertRule) *AlertEngine + func (e *AlertEngine) Evaluate(snap StatsSnapshot) []Alert + func (e *AlertEngine) GetAlerts() []Alert + func (e *AlertEngine) LoadRules(data []byte) error + type AlertRule struct + Action string + Condition string + Field string + Name string + Operator string + Protocol string + Value int64 + Webhook string + type SessionInfo struct + Bytes int64 + DstAddr string + FirstSeen time.Time + LastSeen time.Time + Packets int64 + Protocol string + SrcAddr string + type Stats struct + ProtocolCount map[string]*atomic.Int64 + Sessions map[string]*SessionInfo + StartTime time.Time + TotalBytes atomic.Int64 + TotalPackets atomic.Int64 + func NewStats() *Stats + func (s *Stats) Record(proto string, size int, src, dst string) + func (s *Stats) Snapshot() StatsSnapshot + type StatsSnapshot struct + BPS float64 + Duration time.Duration + PPS float64 + Protocols map[string]int64 + TopSessions []*SessionInfo + TotalBytes int64 + TotalPackets int64 + func (s StatsSnapshot) FormatText() string