chat

package
v0.0.0-...-b89eba7 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const AuthLimitTimeout = 10 * time.Second

Variables

This section is empty.

Functions

func CheckAuth

func CheckAuth(s socketio.Conn) (*model.Token, bool)

CheckAuth 检查token是否有效,有效返回token,否则断开链接

func CheckConnCtxToken

func CheckConnCtxToken(v interface{}) (*model.Token, errcode.Err)

CheckConnCtxToken 检查连接上下文中的token是否有效,有效返回token 参数: 连接上下文 成功: 上下文中包含 *model.Token 且有效 失败: 返回 myerr.AuthenticationFailed,myerr.AuthOverTime

func MustAccount

func MustAccount(accessToken string) (*model.Token, errcode.Err)

MustAccount 解析token并判断是否是账户,返回token 参数: accessToken 成功: 解析token的content并进行校验返回*model.Token,nil 失败: 返回 myerr.AuthenticationFailed,myerr.UserNotFound,errcode.ErrServer

Types

type Group

type Group struct {
	Message message
	Handle  handle
}

Jump to

Keyboard shortcuts

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