utils

package
v0.0.0-...-a25e0fb Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(ttl time.Duration, payload interface{}, privateKey string) (string, error)

func EncodeMD5

func EncodeMD5(value string) string

func GenerateToken

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

func HashPassword

func HashPassword(password string) (string, error)

func ValidateToken

func ValidateToken(token string, publicKey string) (interface{}, error)

func VerifyPassword

func VerifyPassword(hashedPassword string, candidatePassword string) error

Types

type Claims

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

func ParseToken

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

Jump to

Keyboard shortcuts

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