helpers

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(username string, secretKey []byte) (string, error)

Function to create JWT tokens with claims

func GetSecret

func GetSecret() []byte

func GetValidate

func GetValidate() *validator.Validate

func HashPassword

func HashPassword(password string) (string, error)

func ParseToken

func ParseToken(tokenString string, secretKey []byte) (*jwt.Token, error)

func RandomString

func RandomString(length int) string

func VerifyPassword

func VerifyPassword(password, hash string) error

func VerifyTokenAndMapClaims

func VerifyTokenAndMapClaims(tokenString string, secretKey []byte) (jwt.MapClaims, error)

Types

type Service

type Service interface {
	Setup(config string) error
	Update(value *models.UpdaetValue) ([]models.UpdateResult, error)
}

func GetService

func GetService(service string) Service

Jump to

Keyboard shortcuts

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