lib

package
v0.0.0-...-812bafd Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Template *template.Template

Functions

func Error

func Error(w http.ResponseWriter, statusCode int, message string)

func ExeTemplate

func ExeTemplate(w http.ResponseWriter, templateFile string, data any)

function to run html template

func HashPassword

func HashPassword(password string) (string, error)

func IsEmailValid

func IsEmailValid(e string) bool

func LogErrors

func LogErrors(errorLogFile string)

This function is set a log file All errors will be store in errorLogFile

func Mail

func Mail(email *mail.Email)

func RandToken

func RandToken() string

func SendRegisterMail

func SendRegisterMail(data map[string]any, to ...string) *mail.Email

func Success

func Success(w http.ResponseWriter, data any)

func TemplateParseGlob

func TemplateParseGlob(ThemePath string)

Types

type JwtStruct

type JwtStruct struct {
	SecretKey       string
	SessionLifetime time.Duration
}
var J JwtStruct

func (JwtStruct) GenerateJWT

func (j JwtStruct) GenerateJWT(cli map[string]any) (string, error)

Generate JWT token

func (JwtStruct) VerifyJWT

func (j JwtStruct) VerifyJWT(tokenString string) (jwt.MapClaims, error)

Jump to

Keyboard shortcuts

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