search

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Applier

func Applier[T any]() func(T) orm.ApplyFunc[orm.ConditionBuilder]

Types

type Condition

type Condition struct {
	Index    []int
	Alias    string
	Columns  []string
	Operator Operator
	Params   map[string]string
}

type Operator

type Operator string
const (
	Equals             Operator = "eq"
	NotEquals          Operator = "neq"
	GreaterThan        Operator = "gt"
	GreaterThanOrEqual Operator = "gte"
	LessThan           Operator = "lt"
	LessThanOrEqual    Operator = "lte"

	Between    Operator = "between"
	NotBetween Operator = "notBetween"

	In    Operator = "in"
	NotIn Operator = "notIn"

	IsNull    Operator = "isNull"
	IsNotNull Operator = "isNotNull"

	Contains      Operator = "contains"
	NotContains   Operator = "notContains"
	StartsWith    Operator = "startsWith"
	NotStartsWith Operator = "notStartsWith"
	EndsWith      Operator = "endsWith"
	NotEndsWith   Operator = "notEndsWith"

	ContainsIgnoreCase      Operator = "iContains"
	NotContainsIgnoreCase   Operator = "iNotContains"
	StartsWithIgnoreCase    Operator = "iStartsWith"
	NotStartsWithIgnoreCase Operator = "iNotStartsWith"
	EndsWithIgnoreCase      Operator = "iEndsWith"
	NotEndsWithIgnoreCase   Operator = "iNotEndsWith"

	TagSearch = "search"

	AttrDive     = "dive"
	AttrAlias    = "alias"
	AttrColumn   = "column"
	AttrOperator = "operator"
	AttrParams   = "params"

	ParamDelimiter = "delimiter"
	ParamType      = "type"

	IgnoreField = "-"
)
type Search struct {
	// contains filtered or unexported fields
}

func New

func New(typ reflect.Type) Search

func NewFor

func NewFor[T any]() Search

func (Search) Apply

func (f Search) Apply(cb orm.ConditionBuilder, target any, defaultAlias ...string)

Jump to

Keyboard shortcuts

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