Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // SortOptionsByQueryParam is a map to translate the "sort" query param values to SortOption(s) SortOptionsByQueryParam = map[string]model.SortOption{ "login-asc": newSortOption("login", false, 0), "login-desc": newSortOption("login", true, 0), "email-asc": newSortOption("email", false, 1), "email-desc": newSortOption("email", true, 1), "name-asc": newSortOption("name", false, 2), "name-desc": newSortOption("name", true, 2), "lastSeenAtAge-asc": newTimeSortOption("last_seen_at", false, 3), "lastSeenAtAge-desc": newTimeSortOption("last_seen_at", true, 3), } ErrorUnknownSortingOption = errutil.BadRequest("unknown sorting option") )
Functions ¶
func ParseSortQueryParam ¶
func ParseSortQueryParam(param string) ([]model.SortOption, error)
ParseSortQueryParam parses the "sort" query param and returns an ordered list of SortOption(s)
Types ¶
Click to show internal directories.
Click to hide internal directories.