Documentation
¶
Index ¶
- func PublishAuditLogsChanged()
- func PublishGroupsChanged(groupId string)
- func PublishGroupsDeleted(groupId string)
- func PublishRolesChanged(roleId string)
- func PublishRolesDeleted(roleId string)
- func PublishSessionsChanged(sessionId string)
- func PublishSessionsDeleted(sessionId string)
- func PublishSpaceChanged(spaceId, userId string, optionalIds ...string)
- func PublishSpaceDeleted(spaceId, userId string)
- func PublishTemplateVarsChanged(templateVarId string)
- func PublishTemplateVarsDeleted(templateVarId string)
- func PublishTemplatesChanged(templateId string)
- func PublishTemplatesDeleted(templateId string)
- func PublishTokensChanged(tokenId string)
- func PublishTokensDeleted(tokenId string)
- func PublishTunnelsChanged(tunnelId string)
- func PublishTunnelsDeleted(tunnelId string)
- func PublishUsersChanged(userId string)
- func PublishUsersDeleted(userId string)
- func PublishVolumesChanged(volumeId string)
- func PublishVolumesDeleted(volumeId string)
- type Client
- type Event
- type EventType
- type Hub
- type ResourcePayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PublishAuditLogsChanged ¶
func PublishAuditLogsChanged()
PublishAuditLogsChanged notifies clients that audit logs have changed
func PublishGroupsChanged ¶
func PublishGroupsChanged(groupId string)
PublishGroupsChanged notifies clients that a group has changed
func PublishGroupsDeleted ¶
func PublishGroupsDeleted(groupId string)
PublishGroupsDeleted notifies clients that a group was deleted
func PublishRolesChanged ¶
func PublishRolesChanged(roleId string)
PublishRolesChanged notifies clients that a role has changed
func PublishRolesDeleted ¶
func PublishRolesDeleted(roleId string)
PublishRolesDeleted notifies clients that a role was deleted
func PublishSessionsChanged ¶
func PublishSessionsChanged(sessionId string)
PublishSessionsChanged notifies clients that a session has changed
func PublishSessionsDeleted ¶
func PublishSessionsDeleted(sessionId string)
PublishSessionsDeleted notifies clients that a session was deleted
func PublishSpaceChanged ¶
PublishSpaceChanged notifies clients that a space was created, updated, or state changed Parameters: spaceId, userId, optional sharedWithUserId, optional previousUserId
func PublishSpaceDeleted ¶
func PublishSpaceDeleted(spaceId, userId string)
PublishSpaceDeleted notifies clients that a space was deleted
func PublishTemplateVarsChanged ¶
func PublishTemplateVarsChanged(templateVarId string)
PublishTemplateVarsChanged notifies clients that a template variable has changed
func PublishTemplateVarsDeleted ¶
func PublishTemplateVarsDeleted(templateVarId string)
PublishTemplateVarsDeleted notifies clients that a template variable was deleted
func PublishTemplatesChanged ¶
func PublishTemplatesChanged(templateId string)
PublishTemplatesChanged notifies clients that a template has changed
func PublishTemplatesDeleted ¶
func PublishTemplatesDeleted(templateId string)
PublishTemplatesDeleted notifies clients that a template was deleted
func PublishTokensChanged ¶
func PublishTokensChanged(tokenId string)
PublishTokensChanged notifies clients that a token has changed
func PublishTokensDeleted ¶
func PublishTokensDeleted(tokenId string)
PublishTokensDeleted notifies clients that a token was deleted
func PublishTunnelsChanged ¶
func PublishTunnelsChanged(tunnelId string)
PublishTunnelsChanged notifies clients that a tunnel has changed
func PublishTunnelsDeleted ¶
func PublishTunnelsDeleted(tunnelId string)
PublishTunnelsDeleted notifies clients that a tunnel was deleted
func PublishUsersChanged ¶
func PublishUsersChanged(userId string)
PublishUsersChanged notifies clients that a user has changed
func PublishUsersDeleted ¶
func PublishUsersDeleted(userId string)
PublishUsersDeleted notifies clients that a user was deleted
func PublishVolumesChanged ¶
func PublishVolumesChanged(volumeId string)
PublishVolumesChanged notifies clients that a volume has changed
func PublishVolumesDeleted ¶
func PublishVolumesDeleted(volumeId string)
PublishVolumesDeleted notifies clients that a volume was deleted
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a connected SSE client
type Event ¶
type Event struct {
Type EventType `json:"type"`
Payload interface{} `json:"payload,omitempty"`
}
Event represents an SSE event to be sent to clients
type EventType ¶
type EventType string
EventType represents the type of SSE event
const ( EventGroupsChanged EventType = "groups:changed" EventGroupsDeleted EventType = "groups:deleted" EventRolesChanged EventType = "roles:changed" EventRolesDeleted EventType = "roles:deleted" EventTemplatesChanged EventType = "templates:changed" EventTemplatesDeleted EventType = "templates:deleted" EventTemplateVarsChanged EventType = "templatevars:changed" EventTemplateVarsDeleted EventType = "templatevars:deleted" EventUsersChanged EventType = "users:changed" EventUsersDeleted EventType = "users:deleted" EventTokensChanged EventType = "tokens:changed" EventTokensDeleted EventType = "tokens:deleted" EventVolumesChanged EventType = "volumes:changed" EventVolumesDeleted EventType = "volumes:deleted" EventSessionsChanged EventType = "sessions:changed" EventSessionsDeleted EventType = "sessions:deleted" EventTunnelsChanged EventType = "tunnels:changed" EventTunnelsDeleted EventType = "tunnels:deleted" EventAuditLogsChanged EventType = "auditlogs:changed" // Space events for frequently changing data EventSpaceChanged EventType = "space:changed" EventSpaceDeleted EventType = "space:deleted" // Authentication events EventAuthRequired EventType = "auth:required" )
Resource change events - *:changed for creates/updates, *:deleted for deletions
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub manages all SSE client connections and event broadcasting
func (*Hub) BroadcastToUser ¶
BroadcastToUser sends an event to all clients for a specific user
func (*Hub) ClientCount ¶
ClientCount returns the number of connected clients
func (*Hub) InvalidateSession ¶
InvalidateSession sends an auth required event to all clients with a specific session
type ResourcePayload ¶
type ResourcePayload struct {
Id string `json:"id"`
UserId string `json:"user_id,omitempty"`
PreviousUserId string `json:"previous_user_id,omitempty"`
}
ResourcePayload contains data for resource-specific events