helper

package
v0.0.0-...-2bb31bb Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckOldPasswordHash

func CheckOldPasswordHash(password string, hash string) bool

func CheckPasswordHash

func CheckPasswordHash(password string, hash string) bool

func Contains

func Contains[T string | int](arr []T, item T) bool

func ContainsString

func ContainsString(arr []string, item string) bool

func GenerateRandomString

func GenerateRandomString(length int) string

func GetMD5Hash

func GetMD5Hash(password string) string

func GetUserID

func GetUserID(c *fiber.Ctx) (string, global.ErrorResponse)

func HashPassword

func HashPassword(password string) string

func ValidateBody

func ValidateBody(c *fiber.Ctx, request any) global.ErrorResponse

func ValidateHeader

func ValidateHeader(c *fiber.Ctx, header any) global.ErrorResponse

func ValidateParam

func ValidateParam(c *fiber.Ctx, param any) global.ErrorResponse

func ValidateQuery

func ValidateQuery(c *fiber.Ctx, query any) global.ErrorResponse

func ValidateStruct

func ValidateStruct(request any) []dto.ValidationError

Types

type Tx

type Tx interface {
	Rollback()
	Commit() error
	CheckPanic()
	Get() *gorm.DB
}

type TxManager

type TxManager interface {
	New() Tx
}

func NewTxManager

func NewTxManager(db *gorm.DB) TxManager

Jump to

Keyboard shortcuts

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