auth

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	context.Context
	Invalidate context.CancelFunc
	// contains filtered or unexported fields
}

Token 令牌,用于管理持有者的活动状态

func (*Token) Derive

func (tk *Token) Derive() *Token

Derive 派生的Token

func (*Token) ToString

func (tk *Token) ToString() string

ToString token string 字串

type TokenHub

type TokenHub struct {
	context.Context
	// contains filtered or unexported fields
}

TokenHub 用于维护Token

func NewTokenHub

func NewTokenHub(ctx context.Context) *TokenHub

NewTokenHub 构建一个TokenHub

func (*TokenHub) Reset

func (hub *TokenHub) Reset(tkStr string)

Reset 重置指定token 的滴答 这个方法并不会等待重置成功

func (*TokenHub) TryGet

func (hub *TokenHub) TryGet(tkStr string) *Token

TryGet 尝试获得Token,如果无法获得,抛出异常

Jump to

Keyboard shortcuts

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