Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtoiDefault ¶
AtoiDefault converts a string to int and returns def on parse failure.
func MapPredicates ¶
MapPredicates projects parsed predicates into consumer-specific predicate types.
func ParsePredicateKey ¶
ParsePredicateKey splits filter keys like "title__ilike".
func ValuesFromAny ¶
ValuesFromAny normalizes scalar/array filter values into a string slice.
Types ¶
type Options ¶
type Options[T any] struct { Page int `json:"page"` PerPage int `json:"per_page"` SortBy string `json:"sort_by"` SortDesc bool `json:"sort_desc"` Filters map[string]any `json:"filters"` Predicates []T `json:"predicates"` Fields []string `json:"fields"` Search string `json:"search"` }
Options projects Result into consumer-specific predicate types. The field layout intentionally mirrors admin and boot list option structs.
type Predicate ¶
type Predicate struct {
Field string `json:"field"`
Operator string `json:"operator"`
Values []string `json:"values"`
}
Predicate describes a single parsed operator-aware filter.
func PredicatesFromFilters ¶
PredicatesFromFilters converts a filter map into normalized predicates.
type Result ¶
type Result struct {
Page int `json:"page"`
PerPage int `json:"per_page"`
SortBy string `json:"sort_by"`
SortDesc bool `json:"sort_desc"`
Search string `json:"search"`
Filters map[string]any `json:"filters"`
Predicates []Predicate `json:"predicates"`
Fields []string `json:"fields"`
}
Result captures normalized list query options.
Click to show internal directories.
Click to hide internal directories.