filters

package
v0.0.0-...-6a54f0a Latest Latest
Warning

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

Go to latest
Published: May 22, 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[T any] interface {
	Apply(db *gorm.DB, values []string, rp *udatabase.ResourcePage[T]) (*gorm.DB, error)
	ValuedFilterFunc(values ...string) ValuedFilter[T]
}

type LimitFilter

type LimitFilter[T any] struct {
	// contains filtered or unexported fields
}

func Limit

func Limit[T any](defaultValue int) *LimitFilter[T]

func (*LimitFilter[T]) Apply

func (f *LimitFilter[T]) Apply(db *gorm.DB, values []string, rp *udatabase.ResourcePage[T]) (*gorm.DB, error)

func (*LimitFilter[T]) ValuedFilterFunc

func (f *LimitFilter[T]) ValuedFilterFunc(values ...string) ValuedFilter[T]

type NumFieldFilter

type NumFieldFilter[T any] struct {
	// contains filtered or unexported fields
}

func NumField

func NumField[T any](field string) *NumFieldFilter[T]

func (*NumFieldFilter[T]) Apply

func (f *NumFieldFilter[T]) Apply(db *gorm.DB, values []string, _ *udatabase.ResourcePage[T]) (*gorm.DB, error)

func (*NumFieldFilter[T]) ValuedFilterFunc

func (f *NumFieldFilter[T]) ValuedFilterFunc(values ...string) ValuedFilter[T]

type OffsetFilter

type OffsetFilter[T any] struct {
}

func Offset

func Offset[T any]() *OffsetFilter[T]

func (*OffsetFilter[T]) Apply

func (f *OffsetFilter[T]) Apply(db *gorm.DB, values []string, rp *udatabase.ResourcePage[T]) (*gorm.DB, error)

func (*OffsetFilter[T]) ValuedFilterFunc

func (f *OffsetFilter[T]) ValuedFilterFunc(values ...string) ValuedFilter[T]

type SorterFilter

type SorterFilter[T any] struct {
	// contains filtered or unexported fields
}

func Sorter

func Sorter[T any](allowedFields ...string) *SorterFilter[T]

func (*SorterFilter[T]) Apply

func (f *SorterFilter[T]) Apply(db *gorm.DB, values []string, _ *udatabase.ResourcePage[T]) (*gorm.DB, error)

func (*SorterFilter[T]) ValuedFilterFunc

func (f *SorterFilter[T]) ValuedFilterFunc(values ...string) ValuedFilter[T]

type TextFieldFilter

type TextFieldFilter[T any] struct {
	// contains filtered or unexported fields
}

func TextField

func TextField[T any](field string) *TextFieldFilter[T]

func (*TextFieldFilter[T]) Apply

func (f *TextFieldFilter[T]) Apply(db *gorm.DB, values []string, _ *udatabase.ResourcePage[T]) (*gorm.DB, error)

func (*TextFieldFilter[T]) ValuedFilterFunc

func (f *TextFieldFilter[T]) ValuedFilterFunc(values ...string) ValuedFilter[T]

type ValuedFilter

type ValuedFilter[T any] func(db *gorm.DB, rp *udatabase.ResourcePage[T]) (*gorm.DB, error)

Jump to

Keyboard shortcuts

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