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 JwtTokenAccessor ¶
type JwtTokenAccessor struct { }
func (*JwtTokenAccessor) DecodeAccessToken ¶
func (g *JwtTokenAccessor) DecodeAccessToken(tokenStr string) (resp map[string]interface{}, err error)
func (*JwtTokenAccessor) EncodeAccessToken ¶
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) }
Click to show internal directories.
Click to hide internal directories.