filter

package
v0.0.0-...-e98d214 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 5 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" example:"1"`
	Limit  int    `query:"limit" form:"limit" example:"10"`
	Sort   string `query:"sort" form:"sort" example:"'updated_at', 'created_at', 'name' or some other field of the response object"`
	Order  string `query:"order" form:"order" example:"descending order 'desc' or ascending order 'asc'"`
}

func NewFilter

func NewFilter() *Filter

func (*Filter) ApplyOrder

func (s *Filter) ApplyOrder(db *gorm.DB) *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

type UserFilter

type UserFilter struct {
	Filter
	ProfileID uint `query:"profile_id" form:"profile_id" example:"1"`
}

Jump to

Keyboard shortcuts

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