【文件属性】:
文件名称:gin-jwt:用于Gin http框架的JWT中间件
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-01 05:30:53
Go
杜松子酒
用于Gin http框架的JWT中间件。 验证令牌,然后将声明有效负载添加到请求上下文中。
用法
package main
import (
"github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
"github.com/itzamna314/gin-jwt/jwtauth"
)
const superSecretKey = "CAFEBEEF"
func main () {
validator := jwtauth. Validator {
Key : [] byte ( superSecretKey ),
Method : jwt . SigningMethodHS256 ,
Location : new ( string ),
}
* validator . Location =
【文件预览】:
gin-jwt-master
----validator_test.go(3KB)
----validator.go(928B)
----.gitignore(52B)
----README.md(997B)
----Gopkg.toml(802B)
----Gopkg.lock(2KB)