jwt_token

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	goJwt.RegisteredClaims
}

Claims ...

type CoreJWT

type CoreJWT struct {
	Secret  string `json:"secret"`  // jwt密钥
	Timeout int    `json:"timeout"` // jwt过期时间
}

CoreJWT ...

func (*CoreJWT) NewToken

func (c *CoreJWT) NewToken(username string) (string, error)

NewToken 生成新token

func (*CoreJWT) ParseToken

func (c *CoreJWT) ParseToken(token string) (*Claims, error)

ParseToken 解析token

func (*CoreJWT) TokenVerify

func (h *CoreJWT) TokenVerify() gin.HandlerFunc

type ICoreJwt

type ICoreJwt interface {
	NewToken(username string) (string, error)
	ParseToken(token string) (*Claims, error)
}

ICoreJwt ...

Jump to

Keyboard shortcuts

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