Documentation
¶
Index ¶
- Constants
- Variables
- func CheckExpire()
- func CheckExpireScheduledWork()
- func CheckTraffic()
- func IsPingAlertMetric(metric string) bool
- func OfflineNotification(clientID string, endedConnectionID int64)
- func OnlineNotification(clientID string, connectionID int64)
- func ReloadLoadNotificationSchedule(loadNotifications []models.LoadNotification) error
- type LoadNotificationService
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
IsPingAlertMetric 判断该规则是否走 ping 求值路径。
func OfflineNotification ¶
OfflineNotification 在启用通知且未在宽限期内发送的情况下,发送客户端离线通知。
func OnlineNotification ¶
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 重载时间表
Click to show internal directories.
Click to hide internal directories.