filter

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Index

Constants

View Source
const MaxRowsDefault = 100

Variables

View Source
var AllowedColumns = map[string][]string{}

Functions

This section is empty.

Types

type Options

type Options struct {
	Sort   []string `json:"sort,omitempty"`
	Filter []string `json:"filter,omitempty"`
	Group  []string `json:"group,omitempty"`
	Search string   `json:"search,omitempty"`
	Params *Params  `json:"params,omitempty"`
}

type OptionsMap

type OptionsMap map[string]*Options

func (OptionsMap) Get

func (m OptionsMap) Get(key string) *Options

type Ordering

type Ordering struct {
	Column string `json:"column"`
	Asc    bool   `json:"asc"`
}

func (Ordering) String

func (o Ordering) String() string

type Orderings

type Orderings []*Ordering

type ParamSet

type ParamSet map[string]*Params

func (ParamSet) Get

func (s ParamSet) Get(key string, allowed []string, logger util.Logger) *Params

func (ParamSet) String

func (s ParamSet) String() string

type Params

type Params struct {
	Key       string    `json:"key"`
	Orderings Orderings `json:"orderings,omitempty"`
	Limit     int       `json:"limit,omitempty"`
	Offset    int       `json:"offset,omitempty"`
}

func ParamsWithDefaultOrdering

func ParamsWithDefaultOrdering(key string, params *Params, orderings ...*Ordering) *Params

func (*Params) CloneLimit

func (p *Params) CloneLimit(limit int) *Params

func (*Params) CloneOrdering

func (p *Params) CloneOrdering(orderings ...*Ordering) *Params

func (*Params) Filtered

func (p *Params) Filtered(available []string, logger util.Logger) *Params

func (*Params) GetOrdering

func (p *Params) GetOrdering(col string) *Ordering

func (*Params) HasNextPage

func (p *Params) HasNextPage(count int) bool

func (*Params) HasPreviousPage

func (p *Params) HasPreviousPage() bool

func (*Params) NextPage

func (p *Params) NextPage() *Params

func (*Params) OrderByString

func (p *Params) OrderByString() string

func (*Params) PreviousPage

func (p *Params) PreviousPage() *Params

func (*Params) Sanitize

func (p *Params) Sanitize(key string, defaultOrderings ...*Ordering) *Params

func (*Params) String

func (p *Params) String() string

func (*Params) ToQueryString

func (p *Params) ToQueryString(u *fasthttp.URI) string

func (*Params) WithLimit added in v0.2.12

func (p *Params) WithLimit(n int) *Params

Jump to

Keyboard shortcuts

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