util

package
v0.0.0-...-61dbfe3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeMD5

func EncodeMD5(value string) string

EncodeMD5 md5 encryption

func GenerateToken

func GenerateToken(userId int, userName, password string) (string, error)

GenerateToken generate tokens used for auth

func GetPage

func GetPage(c *gin.Context) int

func Setup

func Setup()

Setup Initialize the util

func StructToMapByReflect

func StructToMapByReflect(obj interface{}) map[string]interface{}

StructToMapByReflect

Types

type Claims

type Claims struct {
	UserId   int    `json:"userId"`
	UserName string `json:"userName"`
	Password string `json:"password"`
	jwt.StandardClaims
}

func ParseToken

func ParseToken(token string) (*Claims, error)

ParseToken parsing token

Jump to

Keyboard shortcuts

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