filters

package
v5.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IfEmail         = IfStrEQ("email")
	IfEnabled       = IfBool("enabled")
	IfOrderByIDDesc = IfOrderByDesc("id")
	IfNameLike      = If(func(s string) bool {
		return s != ""
	}, func(t string) func(*sql.Selector) {
		return sql.FieldContains("name", t)
	})
)

Functions

func If

func If[T any](condition Condition[T], fn func(t T) func(*sql.Selector)) func(T) func(*sql.Selector)

func IfBool

func IfBool(field string) func(*bool) func(*sql.Selector)

func IfIntEQ

func IfIntEQ[T ~int | ~int32](field string) func(T) func(*sql.Selector)

func IfOrderByDesc

func IfOrderByDesc(field string) func(*bool) func(*sql.Selector)

func IfStrEQ

func IfStrEQ(field string) func(string) func(*sql.Selector)

Types

type Condition

type Condition[T any] func(T) bool

type Operation

type Operation string

Jump to

Keyboard shortcuts

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