token

package
v0.0.0-...-d61a02a Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingHeader = errors.New("the length of the `Authorization` header is zero")

ErrMissingHeader 表示 `Authorization` 请求头为空.

Functions

func Init

func Init(key string, identityKey string)

func Parse

func Parse(tokenString string, key string) (string, error)

Parse 使用指定的密钥 key 解析 token,解析成功返回 token 上下文,否则报错.

func ParseRequest

func ParseRequest(c *gin.Context) (string, error)

func Sign

func Sign(identityKey string) (tokenString string, err error)

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config 包括 token 包的配置选项.

Jump to

Keyboard shortcuts

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