standard

package
v0.0.0-...-3ada85e Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccessTokenExpireInterval int64
View Source
var AccessTokenIss string
View Source
var AccessTokenKey string

Functions

func InitAccessToken

func InitAccessToken(accessTokenIss, accessTokenKey string)

func InitAccessTokenExpireInterval

func InitAccessTokenExpireInterval(accessTokenExpireInterval int64)

Types

type AccessTokenTicket

type AccessTokenTicket struct {
	AccessToken string `json:"accessToken"`
	ExpiresIn   int64  `json:"expiresIn"`
}

type JwtTokenAccessor

type JwtTokenAccessor struct{}

func (*JwtTokenAccessor) DecodeAccessToken

func (g *JwtTokenAccessor) DecodeAccessToken(tokenStr string) (resp map[string]interface{}, err error)

func (*JwtTokenAccessor) EncodeAccessToken

func (g *JwtTokenAccessor) EncodeAccessToken(jwtId int, uid int, startTime int64) (tokenStr string, err error)

type TokenAccessor

type TokenAccessor interface {
	CreateAccessToken(uid int, startTime int64) (resp AccessTokenTicket, err error)
	CheckAccessToken(tokenStr string) bool
	RefreshAccessToken(tokenStr string, startTime int64) (resp AccessTokenTicket, err error)
	DecodeAccessToken(tokenStr string) (resp map[string]interface{}, err error)
}

Jump to

Keyboard shortcuts

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