q

package
v0.0.0-...-d125d34 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AndList

type AndList struct {
	Values []interface{}
}

AndList query

func NewAndList

func NewAndList(values []interface{}) *AndList

NewAndList creates a new and list

type FuzzyMatchValue

type FuzzyMatchValue struct {
	Value string
}

FuzzyMatchValue query

func NewFuzzyMatchValue

func NewFuzzyMatchValue(value string) *FuzzyMatchValue

NewFuzzyMatchValue creates a new fuzzy match

type KeyWords

type KeyWords = map[string]interface{}

KeyWords ...

type OrList

type OrList struct {
	Values []interface{}
}

OrList query

func NewOrList

func NewOrList(values []interface{}) *OrList

NewOrList creates a new or list

type Query

type Query struct {
	// Filter list
	Keywords KeyWords
	// Sort list
	Sorts []*Sort
	// Page number
	PageNumber int
	// Page size
	PageSize int
	// Without pagination
	WithoutPagination bool
}

Query parameters

func MustClone

func MustClone(query *Query) *Query

MustClone returns the clone of query when it's not nil or returns a new Query instance

func New

func New(kw KeyWords) *Query

New returns Query with keywords

func (*Query) First

func (q *Query) First(sorting ...*Sort) *Query

First make the query only fetch the first one record in the sorting order

func (*Query) Limit

func (q *Query) Limit() int

func (*Query) Offset

func (q *Query) Offset() int

func (*Query) WithPagination

func (q *Query) WithPagination(c *gin.Context) *Query

type Range

type Range struct {
	Min interface{}
	Max interface{}
}

Range query

func NewRange

func NewRange(min, max interface{}) *Range

NewRange creates a new range

type Sort

type Sort struct {
	Key  string
	DESC bool
}

Sort specifies the order information

func NewSort

func NewSort(key string, desc bool) *Sort

NewSort creates new sort

Jump to

Keyboard shortcuts

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