utils

package
v0.0.0-...-c90bac2 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(pwd, dbPwd string) bool

func GenerateToken

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

func GetSecretKey

func GetSecretKey() string

func HashPassword

func HashPassword(pwd string) (string, error)

func TimeNow

func TimeNow() string

Types

type TokenData

type TokenData struct {
	Role     string `json:"id"`
	Username string `json:"username"`
}

func ParseToken

func ParseToken(tokenString string) (*TokenData, error)

Jump to

Keyboard shortcuts

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