modelfilter

package
v2.3.39 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFilters

func ApplyFilters[T any](
	calls []T,
	searchable clause.FieldSearchable,
	getFieldValueFunc GetFieldValueFunc[T],
	expression *clause.ExpressionWhere,
) ([]T, error)

func ApplyLimits

func ApplyLimits[T any](calls []T, offset int, limit int) []T

func FSP

func FSP[T any](objs []T,
	searchable clause.FieldSearchable,
	FilterFunc GetFieldValueFunc[T],
	SorterFunc GetFieldValueFunc[T],
	m *model.Meta[T],
) error

func SortSlice

func SortSlice[T any](
	items []T,
	instructions []clause.ExpressionOrderBy,
	searchable clause.FieldSearchable,
	getValueFunc GetFieldValueFunc[T],
) error

Types

type GetFieldValueFunc

type GetFieldValueFunc[T any] func(call T, field string) (interface{}, error)

Jump to

Keyboard shortcuts

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