Documentation
¶
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func CreateJWT(email string, name string, role string, expirationMinutes int) (string, error)
- func CreateSecureCookie(name string, value string, expiration time.Duration) *fiber.Cookie
- func HashPassword(password string) (string, error)
- func InitDB(config *Config) (*gorm.DB, error)
- func InvalidateCookie(name string) *fiber.Cookie
- func ValidateEmail(email string) (bool, string)
- func ValidateName(name string) (bool, string)
- func ValidatePassword(password string) (bool, string)
- type AuthTokenPair
- type Config
- type MailEnvConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
CheckPasswordHash compares a hashed password with a plain text password
func CreateSecureCookie ¶
func HashPassword ¶
func InvalidateCookie ¶
func InvalidateCookie(name string) *fiber.Cookie
func ValidateEmail ¶
func ValidateName ¶
func ValidatePassword ¶
Types ¶
type AuthTokenPair ¶
func CreateAuthTokenPair ¶
func CreateAuthTokenPair(c *fiber.Ctx, email string, name string, role string) (AuthTokenPair, error)
type Config ¶
func LoadConfig ¶
type MailEnvConfig ¶
type MailEnvConfig struct { SenderEmail string SmtpHost string SmtpPort string SmtpUser string SmtpPass string }
func LoadMailEnv ¶
func LoadMailEnv() (*MailEnvConfig, error)
Click to show internal directories.
Click to hide internal directories.