Documentation
¶
Index ¶
- func AckV2Events(uuid string, ackIDs []string)
- func DeleteClientConditionally(uuid string, connToRemove *connection.SafeConn)
- func DeleteConnectedClients(uuid string)
- func DeleteLatestReport(uuid string)
- func DispatchPing(uuid string, params v2.PingParams) bool
- func DispatchV2Event(uuid, method string, params any) bool
- func EnqueueV2Event(uuid, method string, params any) v2.Event
- func GetAllOnlineUUIDs() []string
- func GetConnectedClient(uuid string) *connection.SafeConn
- func GetConnectedClients() map[string]*connection.SafeConn
- func GetLatestReport(ids ...string) map[string]*v2.Report
- func GetRecentReports(uuid string) []v2.Report
- func IsAgentOnline(uuid string) bool
- func IsV2Client(uuid string) bool
- func KeepAlivePresence(uuid string, connectionID int64, ttl time.Duration)
- func MarkV2Client(uuid string)
- func RecordReport(report v2.Report)
- func SetConnectedClients(uuid string, conn *connection.SafeConn)
- func SetPresence(uuid string, connectionID int64, present bool)
- func TakeV2Events(uuid string, ackIDs []string, limit int) []v2.Event
- func WaitV2Events(uuid string, ackIDs []string, timeout time.Duration) []v2.Event
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AckV2Events ¶
func DeleteClientConditionally ¶
func DeleteClientConditionally(uuid string, connToRemove *connection.SafeConn)
func DeleteConnectedClients ¶
func DeleteConnectedClients(uuid string)
func DeleteLatestReport ¶
func DeleteLatestReport(uuid string)
func DispatchPing ¶
func DispatchPing(uuid string, params v2.PingParams) bool
func DispatchV2Event ¶
func GetAllOnlineUUIDs ¶
func GetAllOnlineUUIDs() []string
GetAllOnlineUUIDs returns a de-duplicated list of online UUIDs from both WebSocket and non-WebSocket agents.
func GetConnectedClient ¶ added in v0.1.16
func GetConnectedClient(uuid string) *connection.SafeConn
GetConnectedClient 返回指定节点的连接;节点不在线时返回 nil。
为什么单独开一个单键访问器:GetConnectedClients 会复制整张连接表,调用方却 大多只查一个 key。adminExec 这类每个客户端查一次、每个在线客户端再查一次的 路径,用整表复制就是每个请求复制整表好几遍。
func GetConnectedClients ¶
func GetConnectedClients() map[string]*connection.SafeConn
func GetRecentReports ¶
func IsAgentOnline ¶
func IsV2Client ¶
func KeepAlivePresence ¶
SetPresence sets or clears presence for non-WebSocket agents. When present=false, it only clears if the connectionID matches current one. KeepAlivePresence sets presence with TTL for non-WebSocket agents.
func MarkV2Client ¶
func MarkV2Client(uuid string)
func RecordReport ¶
RecordReport updates the latest runtime state and keeps only the short raw window used by recent-status compatibility endpoints.
func SetConnectedClients ¶
func SetConnectedClients(uuid string, conn *connection.SafeConn)
func SetPresence ¶
SetPresence keeps compatibility with existing callers.
Types ¶
This section is empty.