Versions in this module Expand all Collapse all v1 v1.0.1 Nov 22, 2024 v1.0.0 Nov 22, 2024 Changes in this version + const DefaultPerPage + const FilterQueryParam + const MaxPerPage + const PageQueryParam + const PerPageQueryParam + const SkipTotalQueryParam + const SortAsc + const SortDesc + const SortQueryParam + type FieldResolver interface + Resolve func(field string) (*ResolverResult, error) + UpdateQuery func(query *dbx.SelectQuery) error + type FilterData string + func (f FilterData) BuildExpr(fieldResolver FieldResolver, placeholderReplacements ...dbx.Params) (dbx.Expression, error) + type Provider struct + func NewProvider(fieldResolver FieldResolver) *Provider + func (s *Provider) AddFilter(filter FilterData) *Provider + func (s *Provider) AddSort(field SortField) *Provider + func (s *Provider) CountCol(name string) *Provider + func (s *Provider) Exec(items any) (*Result, error) + func (s *Provider) Filter(filter []FilterData) *Provider + func (s *Provider) Page(page int) *Provider + func (s *Provider) Parse(urlQuery string) error + func (s *Provider) ParseAndExec(urlQuery string, modelsSlice any) (*Result, error) + func (s *Provider) PerPage(perPage int) *Provider + func (s *Provider) Query(query *dbx.SelectQuery) *Provider + func (s *Provider) SkipTotal(skipTotal bool) *Provider + func (s *Provider) Sort(sort []SortField) *Provider + type ResolverResult struct + AfterBuild func(expr dbx.Expression) dbx.Expression + Identifier string + MultiMatchSubQuery dbx.Expression + NoCoalesce bool + Params dbx.Params + type Result struct + Items any + Page int + PerPage int + TotalItems int + TotalPages int + type SimpleFieldResolver struct + func NewSimpleFieldResolver(allowedFields ...string) *SimpleFieldResolver + func (r *SimpleFieldResolver) Resolve(field string) (*ResolverResult, error) + func (r *SimpleFieldResolver) UpdateQuery(query *dbx.SelectQuery) error + type SortField struct + Direction string + Name string + func ParseSortFromString(str string) (fields []SortField) + func (s *SortField) BuildExpr(fieldResolver FieldResolver) (string, error)