filter

package
v0.5.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EQ   = string(qf.EQ)
	NOT  = string(qf.NOT)
	GT   = string(qf.GT)
	LT   = string(qf.LT)
	LIKE = string(qf.LIKE)
	AND  = string(qf.AND)
	OR   = string(qf.OR)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type All

type All []any

All match all.

type Any

type Any []any

Any match any.

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

Filter builder.

func (*Filter) And

func (f *Filter) And(field string) (p *Predicate)

And adds a predicate. Example: filter.And("name").Equals("Elmer")

func (*Filter) String

func (f *Filter) String() (s string)

String returns string representation.

type Predicate

type Predicate struct {
	// contains filtered or unexported fields
}

Predicate is a filter query predicate.

func (*Predicate) Eq

func (p *Predicate) Eq(object any) *Predicate

Eq returns a (=) predicate.

func (*Predicate) Gt

func (p *Predicate) Gt(object any) *Predicate

Gt returns a (>) predicate.

func (*Predicate) GtEq

func (p *Predicate) GtEq(object any) *Predicate

GtEq returns a (>=) predicate.

func (*Predicate) Like

func (p *Predicate) Like(object any) *Predicate

Like returns a (~) predicate.

func (*Predicate) Lt

func (p *Predicate) Lt(object any) *Predicate

Lt returns a (<) predicate.

func (*Predicate) LtEq

func (p *Predicate) LtEq(object any) *Predicate

LtEq returns a (<) predicate.

func (*Predicate) NotEq

func (p *Predicate) NotEq(object any) *Predicate

NotEq returns a (!=) predicate.

func (*Predicate) String

func (p *Predicate) String() (s string)

String returns a string representation of the predicate.

Jump to

Keyboard shortcuts

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