Documentation
¶
Index ¶
- func AckV2Events(uuid string, ackIDs []string)
- func DeleteClientConditionally(uuid string, connToRemove *connection.SafeConn)
- func DeleteConnectedClients(uuid string)
- func DeleteLatestReport(uuid string)
- func DeleteV2EventQueue(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 NoteReportClamp(uuid, fields string) bool
- func RecordReport(report v2.Report)
- func ResetClient(uuid string)
- func SetConnectedClients(uuid string, conn *connection.SafeConn)
- func SetPresence(uuid string, connectionID int64, present bool)
- func SweepV2EventQueues()
- func TakeV2Events(uuid string, ackIDs []string, limit int) []v2.Event
- func WaitV2Events(uuid string, ackIDs []string, timeout time.Duration) []v2.Event
- type V2EventWait
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 DeleteV2EventQueue ¶ added in v1.6.29
func DeleteV2EventQueue(uuid string)
DeleteV2EventQueue retires this generation and wakes its long polls. Ordinary disconnects must keep pending, unexpired commands for reconnect delivery.
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 NoteReportClamp ¶ added in v1.6.29
NoteReportClamp emits one warning per resource set until a valid sample recovers or the node is removed. Call only after the report is accepted.
func RecordReport ¶
RecordReport updates the latest runtime state and keeps only the short raw window used by recent-status compatibility endpoints.
func ResetClient ¶ added in v1.7.0
func ResetClient(uuid string)
ResetClient retires connection/presence/commands but preserves measurements. Transport close bypasses the writer mutex so a stalled peer cannot pin reset.
func SetConnectedClients ¶
func SetConnectedClients(uuid string, conn *connection.SafeConn)
func SetPresence ¶
SetPresence keeps compatibility with existing callers.
func SweepV2EventQueues ¶ added in v1.6.29
func SweepV2EventQueues()
SweepV2EventQueues runs on the panel's existing scheduler, not a new worker.
Types ¶
type V2EventWait ¶ added in v1.7.0
type V2EventWait struct {
// contains filtered or unexported fields
}
V2EventWait captures queue identity during credential admission, but never holds that admission while waiting or returns another generation's work.
func PrepareV2EventWait ¶ added in v1.7.0
func PrepareV2EventWait(uuid string, ackIDs []string) V2EventWait