Documentation
¶
Index ¶
Constants ¶
View Source
const ( // SortParameterFieldJobNumber is the name of the field, // job number, in the sort parameter. SortParameterFieldJobNumber SortParameterField = "job_number" // SortParameterFieldLabel is the name of the field, // label, in the sort parameter. SortParameterFieldLabel SortParameterField = "label" // SortParameterDirectionAsc is the name of the direction, // ascending, in the sort parameter. SortParameterDirectionAsc SortParameterDirection = "asc" // SortParameterDirectionDesc is the name of the direction, // descending, in the sort parameter. SortParameterDirectionDesc SortParameterDirection = "desc" )
Variables ¶
This section is empty.
Functions ¶
func IsValidSortParameter ¶
func IsValidSortParameter[SortParameter comparable](parameter SortParameter, validParameters []SortParameter) bool
IsValidSortParameter validates sort parameter fields, and checks they are correct.
func ParseSortParameters ¶
func ParseSortParameters(sortParam []string) (field SortParameterField, direction SortParameterDirection, err error)
ParseSortParameters parses the sort parameters of the form "field:direction"
Types ¶
type SortParameterDirection ¶
type SortParameterDirection string
SortParameterDirection is the direction which you are sorting by
type SortParameterField ¶
type SortParameterField string
SortParameterField is the field you are sorting by
Click to show internal directories.
Click to hide internal directories.