utils

package
v0.0.0-...-31e44ea Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const JWT_CONTEXT_KEY = "jwt_context_key"

JWT_CONTEXT_KEY JWT上下文key

Variables

This section is empty.

Functions

func CreateJwtToken

func CreateJwtToken(name string, dcId int) (string, error)

CreateJwtToken 创建token @param name 名称 @param dcId id

func GetLogger

func GetLogger() *zap.Logger

GetLogger 获取日志对象

func NewLoggerServer

func NewLoggerServer()

NewLoggerServer 创建日志服务

func ParseToken

func ParseToken(token string) (jwt.MapClaims, error)

ParseToken 解析token

Types

type Token

type Token struct {
	Name               string // 名称
	DcId               int    // id
	jwt.StandardClaims        // 内容
}

token结构体

Jump to

Keyboard shortcuts

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