search

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
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 tokens for schema field type identification.
	TypeInt      = "int"
	TypeString   = "str"
	TypeBool     = "bool"
	TypeDecimal  = "dec"
	TypeDate     = "date"
	TypeDateTime = "datetime"
	TypeTime     = "time"
)

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
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