query

package
v0.0.0-...-f52bd68 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(v any) iter.Seq[HandleFunc]

Types

type Field

type Field struct {
	Name  string
	Index []int
	Typ   reflect.Type

	Flag flag.Flag
	Op   op.Operator
	Attr attribute.Attribute
	Key  bun.Ident
}

A Field represents a single Field found in a struct.

func ParseField

func ParseField(sf reflect.StructField) (field Field)

func (Field) ReflectQuery

func (f Field) ReflectQuery(v reflect.Value) reflectype.BunQueryBuilder

type HandleFunc

type HandleFunc func(bun.QueryBuilder) bun.QueryBuilder

func (HandleFunc) BunQueryBuilder

func (f HandleFunc) BunQueryBuilder(q bun.QueryBuilder) bun.QueryBuilder

type StructFields

type StructFields struct {
	List      []Field
	NameIndex map[string]int
}

func CachedTypeFields

func CachedTypeFields(t reflect.Type) StructFields

CachedTypeFields is like TypeFields but uses a cache to avoid repeated work.

func TypeFields

func TypeFields(t reflect.Type) StructFields

TypeFields returns a List of fields that JSON should recognize for the given type. The algorithm is breadth-first search over the set of structs to include - the top struct and then any reachable anonymous structs.

Jump to

Keyboard shortcuts

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