Documentation
¶
Overview ¶
Package auth provides authenticator constructors for the realtime framework. Package auth 提供 realtime 框架的认证器构造函数,支持匿名和静态令牌两种认证方式。
Index ¶
Constants ¶
This section is empty.
Variables ¶
ErrUnauthorized 表示认证凭证缺失或不匹配。
Functions ¶
func Anonymous ¶
func Anonymous() realtime.Authenticator
Anonymous returns an authenticator that always succeeds. Anonymous 返回始终通过的认证器,适合本地开发或匿名连接场景。
func StaticToken ¶
func StaticToken(token string, identity realtime.Identity) realtime.Authenticator
StaticToken authenticates a fixed bearer token and returns an identity snapshot. StaticToken 返回固定 Bearer token 认证器,成功后返回 identity 的副本。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.