tools

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUUID

func GetUUID() string

Types

type JWT

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

func NewJWT

func NewJWT(secret string, expire int64) *JWT

NewJWT 创建jwt实例

func (*JWT) GenerateToken

func (j *JWT) GenerateToken(claims map[string]interface{}) (string, error)

GenerateToken 生成token

func (*JWT) ParseToken

func (j *JWT) ParseToken(tokenString string) (map[string]interface{}, error)

ParseToken 解析token

type Password

type Password string

func (*Password) Check

func (p *Password) Check(password string) bool

Check 校验密码

func (*Password) Encrypt

func (p *Password) Encrypt() error

Encrypt 加密密码

func (*Password) String

func (p *Password) String() string

Jump to

Keyboard shortcuts

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