Documentation
¶
Index ¶
- Variables
- func AddLoadNotification(clients []string, name string, metric string, threshold float32, ratio float32, ...) (uint, error)
- func AdminAddLoadNotification(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminDeleteLoadNotification(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminDisableOfflineNotification(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminEditLoadNotification(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminEditOfflineNotification(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminEnableOfflineNotification(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminGetAllLoadNotifications(_ context.Context, _ *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminGetMessageSender(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminListOfflineNotifications(_ context.Context, _ *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminSendNotification(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminSetMessageSender(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminTestSendMessage(_ context.Context, _ *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func CheckExpire()
- func CheckExpireScheduledWork()
- func CheckTraffic()
- func DeleteLoadNotification(id []uint) error
- func EditLoadNotification(notifications []*models.LoadNotification) error
- func GetAllLoadNotifications() ([]models.LoadNotification, error)
- func OfflineNotification(clientID string, endedConnectionID int64)
- func OnlineNotification(clientID string, connectionID int64)
- func ReloadLoadNotificationSchedule() error
- type LoadNotificationService
Constants ¶
This section is empty.
Variables ¶
View Source
var LoadNotificationManager = &LoadNotificationService{ tasks: make(map[int][]models.LoadNotification), }
Functions ¶
func AddLoadNotification ¶
func AdminAddLoadNotification ¶
func AdminAddLoadNotification(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminDeleteLoadNotification ¶
func AdminDeleteLoadNotification(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminDisableOfflineNotification ¶
func AdminDisableOfflineNotification(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminEditLoadNotification ¶
func AdminEditLoadNotification(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminEditOfflineNotification ¶
func AdminEditOfflineNotification(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminEnableOfflineNotification ¶
func AdminEnableOfflineNotification(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminGetAllLoadNotifications ¶
func AdminGetAllLoadNotifications(_ context.Context, _ *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminGetMessageSender ¶
func AdminGetMessageSender(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminListOfflineNotifications ¶
func AdminListOfflineNotifications(_ context.Context, _ *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminSendNotification ¶
func AdminSendNotification(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
AdminSendNotification 发送一条通知。仅供外部(插件/脚本)通过 RPC 调用, 内部通知逻辑(offline/renewal/session 等)直接调用 SendNotification。
func AdminSetMessageSender ¶
func AdminSetMessageSender(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminTestSendMessage ¶
func AdminTestSendMessage(_ context.Context, _ *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
AdminTestSendMessage 发送一条测试通知,供后台"测试消息发送渠道"按钮调用。
func CheckExpire ¶
func CheckExpire()
func CheckExpireScheduledWork ¶
func CheckExpireScheduledWork()
func CheckTraffic ¶
func CheckTraffic()
CheckTraffic 检查各客户端流量使用情况,并在达到阈值和每+5%时提醒一次;100%时额外提醒一次 由外部协程每分钟调用一次
func DeleteLoadNotification ¶
func EditLoadNotification ¶
func EditLoadNotification(notifications []*models.LoadNotification) error
func GetAllLoadNotifications ¶
func GetAllLoadNotifications() ([]models.LoadNotification, error)
func OfflineNotification ¶
OfflineNotification 在启用通知且未在宽限期内发送的情况下,发送客户端离线通知。
func OnlineNotification ¶
OnlineNotification records the connection state and, when enabled, sends a client online notification.
func ReloadLoadNotificationSchedule ¶
func ReloadLoadNotificationSchedule() error
Types ¶
type LoadNotificationService ¶
type LoadNotificationService struct {
// contains filtered or unexported fields
}
LoadNotificationService 管理定时器和任务
func (*LoadNotificationService) Reload ¶
func (m *LoadNotificationService) Reload(loadNotifications []models.LoadNotification) error
Reload 重载时间表
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
outboundhttp
Package outboundhttp provides the HTTP client used by configurable notification senders.
|
Package outboundhttp provides the HTTP client used by configurable notification senders. |
Click to show internal directories.
Click to hide internal directories.