helper

package
v0.0.0-...-3c2c734 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJwt

func GenerateJwt(user entity.User, secret string) (string, error)

func GetPageMeta

func GetPageMeta(db *gorm.DB, entity any, page, size *uint) (*model.PageMeta, error)

func GetValidationErrorsResponse

func GetValidationErrorsResponse(c *fiber.Ctx) []*model.ValidationErrorResponse

func PaginateGorm

func PaginateGorm(page, size *uint) func(db *gorm.DB) *gorm.DB

how to use: db.Scopes(PaginateGorm(page, size)).Find()

func ParseAndValidateRequest

func ParseAndValidateRequest[T any](c *fiber.Ctx, validate *validator.Validate, request *T, options ParseOptions) error

func ParseJwt

func ParseJwt(tokenString, secret string) (model.JwtClaims, error)

Types

type ParseOptions

type ParseOptions struct {
	ParseBody   bool
	ParseQuery  bool
	ParseParams bool
}

Jump to

Keyboard shortcuts

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