utils

package
v0.0.0-...-296dcbf Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AppMode     string
	HttpPort    string
	Db          string
	DbHost      string
	DbPort      string
	DbUser      string
	DbPassword  string
	DbName      string
	JwtKey      string
	AccessKey   string
	SecretKey   string
	Bucket      string
	QiniuServer string
)
View Source
var JwtKeyBytes = []byte(JwtKey)

Functions

func LoadData

func LoadData(file *ini.File)

func LoadFromEnv

func LoadFromEnv()

func LoadServer

func LoadServer(file *ini.File)

func SetToken

func SetToken(username string) (string, error)

SetToken 生成token

Types

type MyClaims

type MyClaims struct {
	Username string `json:"username"`
	jwt.RegisteredClaims
}

func CheckToken

func CheckToken(tokenString string) (*MyClaims, error)

CheckToken 验证token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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