jwt

package
v0.0.0-...-7b0e155 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(apply Request) (string, error)

Generate 生成JSON WEB TOKEN 生成普通的Token

func WithJWT

func WithJWT(method jwt.SigningMethod, publicKey interface{}) gin.HandlerFunc

WithJWT JWT中间件,访问API时做Token校验

Types

type Request

type Request struct {
	ClientID   string            // 客户端ID
	PrivateKey interface{}       // 对应签名类型的私钥
	Expire     time.Duration     // Token有效期
	Method     jwt.SigningMethod // WithJWT 签名类型
}

Jump to

Keyboard shortcuts

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