jwt

package
v0.41.8 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(opts ...Option)

Init 初始化

func Token added in v0.20.3

func Token(data ...map[string]interface{}) (string, error)

Token 生成 token

func TokenWithKey added in v0.21.3

func TokenWithKey(key []byte, data ...map[string]interface{}) (string, error)

TokenWithKey 生成 token

func Verify added in v0.20.3

func Verify(s string) (map[string]interface{}, error)

Verify 验证 token,并获取自定义内容

func VerifyWithKey added in v0.21.3

func VerifyWithKey(key []byte, s string) (map[string]interface{}, error)

VerifyWithKey 验证 token,并获取自定义内容

Types

type Option

type Option struct {
	// Secret 签名密钥
	Secret []byte
	// Exp 过期时间
	Exp time.Duration
}

Option ..

Jump to

Keyboard shortcuts

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