utils

package
v0.0.0-...-c6ee93b Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Error           = iota // 内部错误
	Success                //成功
	Fail                   // 失败
	RegisterSuccess        //注册成功
	RegisterFail           //注册失败
	LoginSuccess           //登录成功
	LoginFail              //登录失败
	OrderSuccess           //下单成功
	OrderFail              //下单失败
	PurchaseSuccess        //购买成功
	PurchaseFail           //购买失败
	ForwardSuccess         //转发成功
	ForwardFail            //转发失败
	TokenSuccess           //Token正确
	TokenFail              //Token错误
)

Variables

View Source
var Secret = []byte(viper.GetString("server.secret"))

Functions

func Check

func Check(ctx *gin.Context) bool

func GetGinH

func GetGinH(rule int, msg string) gin.H

func GetPairLock

func GetPairLock() (string, string)

func InitLua

func InitLua()

func IssueToken

func IssueToken(name string) (string, bool)

func ParseToken

func ParseToken(tokenString string) (jwt.MapClaims, bool)

Types

type BlackList

type BlackList struct {
	sync.Map
}

func GetBlackList

func GetBlackList() *BlackList

func (*BlackList) Add

func (bl *BlackList) Add(name string)

func (*BlackList) Clear

func (bl *BlackList) Clear()

func (*BlackList) Get

func (bl *BlackList) Get(name string) bool

type MyCustomClaims

type MyCustomClaims struct {
	Name string `json:"name"`
	jwt.RegisteredClaims
}

Jump to

Keyboard shortcuts

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