notifier

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PingAlertMetricLatency 以平均延迟(毫秒)为判据。
	PingAlertMetricLatency = "ping_latency"
	// PingAlertMetricLoss 以丢包率(百分比)为判据。
	PingAlertMetricLoss = "ping_loss"
)

Variables

View Source
var LoadNotificationManager = &LoadNotificationService{
	tasks: make(map[int][]models.LoadNotification),
}

Functions

func CheckExpire

func CheckExpire()

func CheckExpireScheduledWork

func CheckExpireScheduledWork()

func CheckTraffic

func CheckTraffic()

CheckTraffic 检查各客户端流量使用情况,并在达到阈值和每+5%时提醒一次;100%时额外提醒一次 由外部协程每分钟调用一次

func IsPingAlertMetric added in v0.1.1

func IsPingAlertMetric(metric string) bool

IsPingAlertMetric 判断该规则是否走 ping 求值路径。

func OfflineNotification

func OfflineNotification(clientID string, endedConnectionID int64)

OfflineNotification 在启用通知且未在宽限期内发送的情况下,发送客户端离线通知。

func OnlineNotification

func OnlineNotification(clientID string, connectionID int64)

OnlineNotification records the connection state and, when enabled, sends a client online notification.

func ReloadLoadNotificationSchedule

func ReloadLoadNotificationSchedule(loadNotifications []models.LoadNotification) error

ReloadLoadNotificationSchedule 加载或重载时间表

Types

type LoadNotificationService

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

LoadNotificationService 管理定时器和任务

func (*LoadNotificationService) Reload

func (m *LoadNotificationService) Reload(loadNotifications []models.LoadNotification) error

Reload 重载时间表

Jump to

Keyboard shortcuts

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