notification

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type        string                 `json:"type"`
	Timestamp   time.Time              `json:"timestamp"`
	IP          string                 `json:"ip"`
	Action      string                 `json:"action"`
	Reason      string                 `json:"reason"`
	ThreatLevel string                 `json:"threat_level"`
	Details     map[string]interface{} `json:"details"`
	Location    *LocationInfo          `json:"location,omitempty"`
}

Event represents a notification event

type LocationInfo

type LocationInfo struct {
	Country   string  `json:"country"`
	City      string  `json:"city"`
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	ISP       string  `json:"isp"`
}

LocationInfo contains geographic information

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles all notification channels

func NewManager

func NewManager(cfg config.NotificationsConfig, logger *logrus.Logger) (*Manager, error)

NewManager creates a new notification manager

func (*Manager) SendIPBlocked

func (m *Manager) SendIPBlocked(ip, reason, action string, duration time.Duration, location *LocationInfo)

SendIPBlocked sends an IP blocked notification

func (*Manager) SendSystemAlert

func (m *Manager) SendSystemAlert(alertType, message string, details map[string]interface{})

SendSystemAlert sends a system-level alert

func (*Manager) SendThreatDetected

func (m *Manager) SendThreatDetected(result *detector.DetectionResult, location *LocationInfo)

SendThreatDetected sends a threat detection notification

func (*Manager) Shutdown

func (m *Manager) Shutdown()

Shutdown gracefully shuts down the notification manager

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL