Versions in this module Expand all Collapse all v0 v0.3.0 Jan 13, 2026 v0.2.0 Jan 13, 2026 v0.1.0 Jan 13, 2026 Changes in this version + const DefaultLimit + const MaxLimit + const MinLimit + var ErrInvalidCursor = errors.New("invalid cursor") + var SupportedOperators = []string + func BuildCondition(field, op string, value any) (query.Condition, error) + func EncodeCursor(c Cursor) string + func MergeWhereClauses(clauses ...*query.WhereClause) *query.WhereClause + func ParseFilterKey(key string) (field, op string) + func ParseFilters(r *http.Request, allowed []string) map[string]any + func ParseQueryParams(r *http.Request, allowedFilters []string, allowedSorts []string) (PageRequest, map[string]any, []SortField) + type Cursor struct + Direction string + Field string + ID string + Value any + func DecodeCursor(s string) (*Cursor, error) + type FilterBuilder struct + func NewFilterBuilder() *FilterBuilder + func (b *FilterBuilder) Allow(field string, ops ...string) *FilterBuilder + func (b *FilterBuilder) AllowAll(fields ...string) *FilterBuilder + func (b *FilterBuilder) Build(params map[string]any) (*query.WhereClause, error) + type FilterDef struct + AllowedOps []string + Field string + type PageInfo struct + HasNext bool + HasPrevious bool + Limit int + NextCursor string + Page *int + PrevCursor string + Total *int64 + type PageRequest struct + After string + Before string + Cursor string + Limit int + Page int + Type PaginationType + func DefaultPageRequest() PageRequest + func ParsePageRequest(r *http.Request) PageRequest + func (pr *PageRequest) GetCursor() string + func (pr *PageRequest) GetOffset() int + func (pr *PageRequest) IsCursorPagination() bool + func (pr *PageRequest) Validate() + type PageResponse struct + Data []T + Pagination PageInfo + type PaginationType string + const PaginationCursor + const PaginationOffset + type Paginator struct + func NewPaginator(executor *query.Executor, entity string) *Paginator + func (p *Paginator) Execute(ctx context.Context, req PageRequest) (*PageResponse[map[string]any], error) + func (p *Paginator) WithFields(fields []string) *Paginator + func (p *Paginator) WithInclude(include []string) *Paginator + func (p *Paginator) WithOrderBy(orderBy []query.OrderClause) *Paginator + func (p *Paginator) WithTotal(include bool) *Paginator + func (p *Paginator) WithWhere(where *query.WhereClause) *Paginator + type SortField struct + Desc bool + Field string + func ParseSort(r *http.Request, allowed []string) []SortField