jwt

package
v0.0.0-...-1cb6917 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPChcek

func IPChcek(nowip, lastip string) error

IPChcek 检查IP是否变化

func NewToken

func NewToken(p *Payload, secret string) (token []byte, err error)

NewToken JWT 发放token

Types

type EnInfo

type EnInfo struct {
	UserID string `json:"user_id,omitempty"` // 用户ID
	IP     string `json:"ip,omitempty"`      // 用户IP
}

EnInfo ... 加密的信息

func Chcek

func Chcek(secret, token string, audience ...string) (eninfo EnInfo, err error)

Chcek jwt

type Payload

type Payload struct {
	jwt.Payload
	EnInfo EnInfo // 加密信息
}

Payload jwt.Payload

Jump to

Keyboard shortcuts

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