filter

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Search string `query:"search" form:"search" example:"name"`
	Page   int    `query:"page" form:"page" minimum:"1" default:"1"`
	Limit  int    `query:"limit" form:"limit" minimum:"1" default:"10"`
	Sort   string `` /* 131-byte string literal not displayed */
	Order  string `query:"order" form:"order" enums:"asc,desc" default:"desc"`
}

func New

func New(sort, order string) *Filter

func (*Filter) ApplyOrder

func (s *Filter) ApplyOrder(db *gorm.DB, tbName *string) *gorm.DB

func (*Filter) ApplyPagination

func (s *Filter) ApplyPagination(db *gorm.DB) *gorm.DB

func (*Filter) ApplySearchLike

func (s *Filter) ApplySearchLike(db *gorm.DB, columns ...string) *gorm.DB

func (*Filter) CalcPages

func (s *Filter) CalcPages(count int64) int64

Jump to

Keyboard shortcuts

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