Documentation
¶
Overview ¶
Package realtime 提供共享身份入口和基于 Redis Stream 的跨实例恢复.
Index ¶
- type Handler
- type Hub
- func (h *Hub) Close()
- func (h *Hub) Drain(ctx context.Context)
- func (h *Hub) Handle(name string, handler Handler) error
- func (h *Hub) Publish(ctx context.Context, to Principal, event string, data any) (string, error)
- func (h *Hub) PublishChannel(ctx context.Context, channel, event string, data any) (string, error)
- func (h *Hub) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (h *Hub) Ticket(ctx context.Context, p Principal, resume, locale string) (string, error)
- type Message
- type Principal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hub ¶
type Hub struct {
Redis redis.UniversalClient
Prefix string
Path string
Origins []string
Validate func(context.Context, Principal) error
Authorize func(context.Context, Principal, string) error
Retention time.Duration
Limit int64
// contains filtered or unexported fields
}
func (*Hub) PublishChannel ¶
Click to show internal directories.
Click to hide internal directories.