util

package
v0.0.0-...-5fda629 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MulanPSL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeMD5

func EncodeMD5(value string) string

func GenerateDeviceInfo

func GenerateDeviceInfo(di DeviceInfo) string

func GenerateToken

func GenerateToken(username, password string) (string, error)

generate tokens used for auth

func GetPage

func GetPage(c *gin.Context) int

func RandInt

func RandInt(min, max int) int

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	Password string `json:"password"`
	jwt.StandardClaims
}

func ParseToken

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

parsing token

type DeviceInfo

type DeviceInfo struct {
	ManufacturerId string
	ProductId      string
	ResourceType   int
	ResourceId     int
}

Jump to

Keyboard shortcuts

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