Documentation
¶
Index ¶
- func AckV2Events(uuid string, ackIDs []string)
- func AdminAddClient(ctx context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminClearRecords(ctx context.Context, _ *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminEditClient(ctx context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminGetClient(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminGetClientToken(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminListClients(_ context.Context, _ *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminOrderClients(ctx context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func AdminRemoveClient(ctx context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
- func DeleteClientConditionally(uuid string, connToRemove *wsconn.SafeConn)
- func DeleteConnectedClients(uuid string)
- func DeleteLatestReport(uuid string)
- func DeleteV2EventQueue(uuid string)
- func DispatchPing(uuid string, params protocol.PingParams) bool
- func DispatchV2Event(uuid, method string, params any) bool
- func EnqueueV2Event(uuid, method string, params any) protocol.Event
- func GetAllOnlineUUIDs() []string
- func GetClients(c *gin.Context)
- func GetConnectedClients() map[string]*wsconn.SafeConn
- func GetLatestReport() map[string]*protocol.Report
- func GetRecentReports(uuid string) []protocol.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 OnOffline(hook PresenceHook)
- func OnOnline(hook PresenceHook)
- func RecordReport(report protocol.Report)
- func RegisterClient(c *gin.Context)
- func SetConnectedClients(uuid string, conn *wsconn.SafeConn)
- func SetDefaultPingTaskApplier(fn func(clientUUID string) error)
- func SetPingResultRecorder(fn func(models.PingRecord) error)
- func SetPresence(uuid string, connectionID int64, present bool)
- func TakeV2Events(uuid string, ackIDs []string, limit int) []protocol.Event
- func UploadV2RPC(c *gin.Context)
- func WaitV2Events(uuid string, ackIDs []string, timeout time.Duration) []protocol.Event
- func WebSocketV2RPC(c *gin.Context)
- type PresenceHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AckV2Events ¶
func AdminAddClient ¶
func AdminAddClient(ctx context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminClearRecords ¶
func AdminClearRecords(ctx context.Context, _ *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminEditClient ¶
func AdminEditClient(ctx context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminGetClient ¶
func AdminGetClient(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminGetClientToken ¶
func AdminGetClientToken(_ context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminListClients ¶
func AdminListClients(_ context.Context, _ *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminOrderClients ¶
func AdminOrderClients(ctx context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func AdminRemoveClient ¶
func AdminRemoveClient(ctx context.Context, req *rpc.JsonRpcRequest) (any, *rpc.JsonRpcError)
func DeleteConnectedClients ¶
func DeleteConnectedClients(uuid string)
func DeleteLatestReport ¶
func DeleteLatestReport(uuid string)
func DeleteV2EventQueue ¶
func DeleteV2EventQueue(uuid string)
DeleteV2EventQueue drops a client's pull-based event queue. Callers must invoke this when a client is deleted; the queue is otherwise never removed on its own, since an empty queue with no pending events looks the same as one that simply hasn't been pruned yet.
func DispatchPing ¶
func DispatchPing(uuid string, params protocol.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 GetClients ¶
func GetConnectedClients ¶
func GetLatestReport ¶
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 OnOffline ¶
func OnOffline(hook PresenceHook)
OnOffline registers a hook to run whenever a client goes offline.
func OnOnline ¶
func OnOnline(hook PresenceHook)
OnOnline registers a hook to run whenever a client comes online.
func RecordReport ¶
RecordReport updates the latest runtime state and keeps only the short raw window used by recent-status compatibility endpoints.
func RegisterClient ¶
func SetConnectedClients ¶
func SetDefaultPingTaskApplier ¶
SetDefaultPingTaskApplier registers the function used to apply default-on ping tasks to a newly created client.
func SetPingResultRecorder ¶
func SetPingResultRecorder(fn func(models.PingRecord) error)
SetPingResultRecorder registers the function used to persist a ping result reported by an agent.
func SetPresence ¶
SetPresence keeps compatibility with existing callers.
func UploadV2RPC ¶
func WaitV2Events ¶
func WebSocketV2RPC ¶
Types ¶
type PresenceHook ¶
PresenceHook is invoked when a client's connectivity state changes. It exists so this package doesn't need to import internal/features/notification directly: notification already depends on this package for connection/report state, so the reverse edge is registered here instead of imported there.