Documentation ¶
Index ¶
- Constants
- Variables
- type Options
- type OptionsMap
- type Ordering
- type Orderings
- type ParamSet
- type Params
- func (p *Params) CloneLimit(limit int) *Params
- func (p *Params) CloneOrdering(orderings ...*Ordering) *Params
- func (p *Params) Filtered(key string, available []string, logger util.Logger) *Params
- func (p *Params) GetOrdering(col string) *Ordering
- func (p *Params) HasNextPage(count int) bool
- func (p *Params) HasPreviousPage() bool
- func (p *Params) IsDefault() bool
- func (p *Params) NextPage() *Params
- func (p *Params) OrderByString() string
- func (p *Params) PreviousPage() *Params
- func (p *Params) Sanitize(key string, defaultOrderings ...*Ordering) *Params
- func (p *Params) String() string
- func (p *Params) ToQueryString(u *url.URL) string
- func (p *Params) WithLimit(n int) *Params
Constants ¶
View Source
const ( PageSize = 100 MaxRows = 10000 SuffixOrder = ".o" SuffixLimit = ".l" SuffixOffset = ".x" SuffixDescending = ".d" )
Variables ¶
View Source
var ( AllowedColumns = map[string][]string{} TransformedColumns = map[string]map[string]string{} )
View Source
var OrderingFieldDescs = util.FieldDescs{
{Key: "column", Title: "Column", Description: "The name of the column to sort by"},
{Key: "asc", Title: "Ascending", Description: "Determines if this ordering is applied ascending or descending"},
}
Functions ¶
This section is empty.
Types ¶
type OptionsMap ¶
func (OptionsMap) Get ¶
func (m OptionsMap) Get(key string) *Options
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 (*Params) CloneLimit ¶
func (*Params) CloneOrdering ¶
func (*Params) GetOrdering ¶
func (*Params) HasNextPage ¶
func (*Params) HasPreviousPage ¶
func (*Params) OrderByString ¶
func (*Params) PreviousPage ¶
Click to show internal directories.
Click to hide internal directories.