Discover Packages
github.com/ifreddyrondon/bastion
middleware
listing
sorting
package
Version:
v3.1.0+incompatible
Opens a new window with list of versions in this module.
Published: May 2, 2019
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 2
Opens a new window with list of known importers.
Documentation
Documentation
¶
A Decoder reads and decodes Sorting values from url.Values.
NewDecoder returns a new decoder that reads from query params.
The first sort criteria if present will be the default Sort
when decode url query params and not params present.
Decode reads the sort-encoded value from params and stores it
in the value pointed to by v. If a value is missing from the params
it'll be filled by their equivalent default value.
type Sort struct {
ID string `json:"id"`
Value string `json:"-"`
Description string `json:"description"`
}
Sort criteria.
NewSort returns a new instance of Sort
MarshalJSON supports json.Marshaler interface
type Sorting struct {
Sort *Sort `json:"sort,omitempty"`
Available []Sort `json:"available,omitempty"`
}
Sorting struct allows to sort a collection.
MarshalJSON supports json.Marshaler interface
Source Files
¶
Click to show internal directories.
Click to hide internal directories.