auth

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package auth provides authenticator constructors for the realtime framework. Package auth 提供 realtime 框架的认证器构造函数,支持匿名和静态令牌两种认证方式。

Index

Constants

This section is empty.

Variables

View Source
var ErrUnauthorized = realtime.ErrUnauthorized

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL