query

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparator

type Comparator string
const (
	ComparatorEqual        Comparator = "eq"
	ComparatorNotEqual     Comparator = "neq"
	ComparatorLess         Comparator = "ls"
	ComparatorGreater      Comparator = "gt"
	ComparatorLessEqual    Comparator = "lseq"
	ComparatorGreaterEqual Comparator = "gteq"
	ComparatorLike         Comparator = "like"
	ComparatorIn           Comparator = "in"
)

type Condition

type Condition struct {
	Name  string
	Comp  Comparator
	Value any
}

func C

func C(name string, comp Comparator, val any) Condition

func (Condition) ValueString

func (c Condition) ValueString() string

type Found

type Found bool

type LimitOffset

type LimitOffset struct {
	Limit  int
	Offset int
}

func LO

func LO(limit, offset int) LimitOffset

func (LimitOffset) OneMore

func (lo LimitOffset) OneMore() LimitOffset

type Query

type Query struct {
	LimitOffset LimitOffset
	Conditions  []Condition
	Sorts       []Sort
	Search      Search
}

func (Query) FindCondition

func (q Query) FindCondition(name string) (Condition, bool)
type Search struct {
	Fields []string
	Value  string
}

func SearchFor

func SearchFor(val string, in ...string) Search

type Sort

type Sort struct {
	Name  string
	Order SortOrder
}

func S

func S(name string, ord SortOrder) Sort

type SortOrder

type SortOrder string
const (
	SortNone SortOrder = "None"
	SortASC  SortOrder = "ASC"
	SortDESC SortOrder = "DESC"
)

Jump to

Keyboard shortcuts

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