standard

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const AccessTokenExpireInterval = 7 * 24 * 60 * 60

TODO(从配置中读取)

View Source
const AccessTokenIss = "github.com/goecology/egoshop"

TODO(两个都从配置里面读取)

View Source
const AccessTokenKey = "ecologysK#xo"

Variables

This section is empty.

Functions

This section is empty.

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(c *gin.Context, uid int, startTime int64) (resp AccessTokenTicket, err error)
	CheckAccessToken(c *gin.Context, tokenStr string) bool
	RefreshAccessToken(c *gin.Context, 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