notification

package
v1.1.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func AddLoadNotification

func AddLoadNotification(clients []string, name string, metric string, threshold float32, ratio float32, interval int) (uint, error)

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 DeleteLoadNotification(id []uint) error

func EditLoadNotification

func EditLoadNotification(notifications []*models.LoadNotification) error

func GetAllLoadNotifications

func GetAllLoadNotifications() ([]models.LoadNotification, error)

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() 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 重载时间表

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.

Jump to

Keyboard shortcuts

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