query

package
v1.57.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFieldByJsonTag

func GetFieldByJsonTag(jsonTagValue string, s interface{}) (reflect.StructField, error)

GetFieldByJsonTag returns the field name as a string from the json value supplied by the request query params

func SortBy

func SortBy(requestSortParameters string, arr []models.UserParams) error

SortBy from the request query get the sort parameters

Types

type LessFunc

type LessFunc func(p1, p2 *models.UserParams) bool

LessFunc used by MultiSorter OrderedBy used to hold the seq of sort

func GetLessFunc

func GetLessFunc(name, field string, direction bool) LessFunc

GetLessFunc supplies the output function from the

type MultiSorter

type MultiSorter struct {
	// contains filtered or unexported fields
}

MultiSorter structure to hold input array and the rwquest query parameters converted see GetLessFunc

func OrderedBy

func OrderedBy(less ...LessFunc) *MultiSorter

OrderedBy some description of the function

func (*MultiSorter) Len

func (ms *MultiSorter) Len() int

Len function to produce length of changes required by Sort third party

func (*MultiSorter) Less

func (ms *MultiSorter) Less(i, j int) bool

Less either swaps the two concurrent values by the sort rules

func (*MultiSorter) Sort

func (ms *MultiSorter) Sort(changes []models.UserParams)

Sort some description of the function

func (*MultiSorter) Swap

func (ms *MultiSorter) Swap(i, j int)

Swap ms called by sort to swap two records by sort parameters

Jump to

Keyboard shortcuts

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