token

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewId

func NewId(uid, clientId string) string

Types

type Token

type Token struct {
	DB *db.DB
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, value db.Value) *Token

func NewOrUseOld

func NewOrUseOld(ctx context.Context, value db.Value) *Token

func Resume

func Resume(ctx context.Context, token string) *Token

func ResumeFromUidClientId

func ResumeFromUidClientId(ctx context.Context, uid, clientId string) (token *Token, ok bool)

func (*Token) Del

func (t *Token) Del()

Del 退出登录时,应该调用此接口删除token数据,可重复多次调用

func (*Token) Id

func (t *Token) Id() string

Id 返回token的值,常用于传递给客户端

func (*Token) Uid

func (t *Token) Uid() string

func (*Token) UidOrInvalid

func (t *Token) UidOrInvalid() (uid string, ok bool)

UidOrInvalid ok true: token is valid, false: invalid

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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