Documentation
¶
Index ¶
- func AlertsWorker(db *sql.DB)
- func AutomationWorker(db *sql.DB)
- func DDNSWorker(db *sql.DB)
- func EnableDDNS()
- func ExpiryWorker(db *sql.DB)
- func ForceUpdate(db *sql.DB) error
- func GetBackoffDuration(failures int) time.Duration
- func GetDDNSStatus() map[string]interface{}
- func LimitWorker(db *sql.DB)
- func MonitorWorker(db *sql.DB)
- func NotificationWorker(db *sql.DB)
- func QueueNotification(db *sql.DB, channel, webhookURL, message string) error
- func RedactURL(input string) string
- func ScheduleWorker(db *sql.DB)
- func SelfHealingWorker(db *sql.DB)
- func StatsWorker()
- func Trigger()
- type DDNSConfig
- type DDNSError
- type SystemStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlertsWorker ¶
func AutomationWorker ¶
AutomationWorker tracks peer handshakes and fires webhooks on state change
func DDNSWorker ¶
DDNSWorker runs the DDNS update loop with production-grade safeguards
func ExpiryWorker ¶
ExpiryWorker checks for expired peers and disables them
func GetBackoffDuration ¶
GetBackoffDuration returns exponential backoff duration
func GetDDNSStatus ¶
func GetDDNSStatus() map[string]interface{}
GetDDNSStatus returns current DDNS status for monitoring
func LimitWorker ¶
LimitWorker checks for peers exceeding data limits and disables them Runs frequently (every 10 seconds) for fast enforcement
func MonitorWorker ¶
func NotificationWorker ¶
NotificationWorker sends alerts to Telegram/Discord
func QueueNotification ¶
QueueNotification adds a notification to the queue
func ScheduleWorker ¶
ScheduleWorker enables/disables peers based on time schedules
func SelfHealingWorker ¶
SelfHealingWorker monitors system health and auto-recovers failed components
Types ¶
type DDNSConfig ¶
type DDNSConfig struct {
Provider string `json:"provider"`
Domain string `json:"domain"`
Token string `json:"token"`
WebhookURL string `json:"webhook_url"`
TTL int `json:"ttl"`
Interval int `json:"interval_minutes"` // Configurable check interval
}
DDNSConfig holds provider-specific configuration
type DDNSError ¶
type DDNSError struct {
Message string
Persistent bool // If true, increment failure counter; if false, transient
}
DDNSError for custom error handling with persistence flag
type SystemStats ¶
type SystemStats struct {
CPUPercent float64 `json:"cpu_percent"`
RAMPercent float64 `json:"ram_percent"`
RAMUsedMB int64 `json:"ram_used_mb"`
RAMTotalMB int64 `json:"ram_total_mb"`
NetworkRX int64 `json:"network_rx_bps"`
NetworkTX int64 `json:"network_tx_bps"`
CPUTempC float64 `json:"cpu_temp_c"`
UptimeSeconds int64 `json:"uptime_seconds"`
DiskPercent float64 `json:"disk_percent"`
}
SystemStats represents the live system metrics
func GetSystemStats ¶
func GetSystemStats() SystemStats
GetSystemStats returns the latest cached system stats safely