Documentation
¶
Index ¶
- func Capabilities() []string
- func RegisterCapability(name string) error
- func RegisterScope(name string) error
- func UserScope(userID string) string
- func WorkspaceScope(workspaceID string) string
- type Authorize
- type Broadcaster
- type Hub
- func (h *Hub) Broadcast(ctx context.Context, scope string, frame wswire.Frame)
- func (h *Hub) BroadcastEvent(ctx context.Context, scope, event string, payload []byte, eventID string) error
- func (h *Hub) DeliverRemote(scope string, frame wswire.Frame)
- func (h *Hub) RoomSize(scope string) int
- func (h *Hub) Rooms() int
- func (h *Hub) SendToUser(ctx context.Context, userID string, frame wswire.Frame)
- func (h *Hub) ServeWS(w http.ResponseWriter, r *http.Request)
- type Metrics
- type PATResolve
- type WorkspaceMember
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Capabilities ¶
func Capabilities() []string
func RegisterCapability ¶
func RegisterScope ¶
func WorkspaceScope ¶
Types ¶
type Broadcaster ¶
type Hub ¶
type Hub struct {
Log *slog.Logger
Metrics Metrics
Authorize Authorize
WorkspaceMember WorkspaceMember
PATResolve PATResolve
PATPrefix string
OnSubscribe func(scope string)
OnUnsubscribe func(scope string)
AllowedOrigins []string
Capabilities []string
Relay interface {
PublishOut(ctx context.Context, scope string, frame wswire.Frame)
}
// contains filtered or unexported fields
}
func (*Hub) BroadcastEvent ¶
func (*Hub) SendToUser ¶
Click to show internal directories.
Click to hide internal directories.