q

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 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 Option

type Option func(*QueryParam)

func Limit

func Limit(limit int64) Option

func Object

func Object(name string) Option

func Offset

func Offset(offset int64) Option

func OrderBy

func OrderBy(orderBy ...Order) Option

OrderBy 排序

func Select

func Select(fieldAPINames ...string) Option

func Where

func Where(condition interface{}) Option

type Order

type Order struct {
	Type   OrderType
	Fields []string
}

func OrderByAsc

func OrderByAsc(fields ...string) Order

OrderByAsc 升序排序

func OrderByDesc

func OrderByDesc(fields ...string) Order

type OrderType

type OrderType int
const (
	OrderTypeAsc OrderType = iota
	OrderTypeDesc
)

type QueryParam

type QueryParam struct {
	ObjName string
	Select  []string
	Where   interface{}
	Offset  int64
	Limit   int64
	OrderBy []Order
}

QueryParam 用于构建查询参数

func (*QueryParam) Check

func (q *QueryParam) Check() error

func (*QueryParam) UseOffsetAndLimit

func (q *QueryParam) UseOffsetAndLimit() bool

Jump to

Keyboard shortcuts

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