Documentation
¶
Index ¶
Constants ¶
View Source
const ( RequestKey request.Key = "RequestArgv" RequestRedirectKey string = "RequestRedirect" RequestIgnoredKey string = "RequestArgvIgnored" RequestConsumedKey string = "RequestArgvConsumed" )
View Source
const ( PatternArgs = `((?:/:[^/]+)+?)` PatternPgntn = `(/\d+/\d+/??)` )
View Source
const ( RouteOneArg = `:{arg0:[^/]+}` RouteTwoArgs = `:{arg0:[^/]+}/:{arg1:[^/]+}` RoutePgntn = `{num-per-page:\d+}/{page-number:\d+}` )
Variables ¶
View Source
var ( RxRequestSplit = regexp.MustCompile(`/:`) RxRequestCase0 = regexp.MustCompile(`^(/[^:]+?)` + PatternArgs + PatternPgntn + `$`) RxRequestCase1 = regexp.MustCompile(`^(/[^:]+?)` + PatternPgntn + `$`) RxRequestCase2 = regexp.MustCompile(`^(/[^:]+?)` + PatternArgs + `$`) RxRequestCase3 = regexp.MustCompile(`^(/[^:]+?)$`) )
Functions ¶
Types ¶
type Argv ¶ added in v0.5.0
type Argv struct {
Path string
Argv [][]string
NumPerPage int
PageNumber int
Language language.Tag
Request *http.Request
}
func DecodeHttpRequest ¶
func DecomposeHttpRequest ¶
func ProcessRequest ¶ added in v0.5.0
func (*Argv) MustConsume ¶ added in v0.5.0
type Pagination ¶ added in v0.5.0
type Pagination struct {
// BasePath is the URL path to use when generating pagination links
BasePath string `json:"BasePath"`
// PageNumber is the current page number in human format (lists start at 1)
PageNumber int `json:"PageNumber"`
// NumPerPage is the number of results per page requested
NumPerPage int `json:"NumPerPage"`
// PageIndex is the current page number in computer format (lists start at 0)
PageIndex int `json:"PageIndex"`
// LastIndex is the last page number in computer format
LastIndex int `json:"LastIndex"`
// TotalItems is the total number of items available
TotalItems int `json:"TotalItems"`
// TotalPages is the total number of pagination pages available
TotalPages int `json:"TotalPages"`
// StartItem is the number of the first item being presented
StartItem int `json:"StartItem"`
// EndItem is the number of the last item being presented
EndItem int `json:"EndItem"`
// SearchQuery is an optional plain text string to be included with generated output
SearchQuery string `json:"SearchQuery"`
}
Click to show internal directories.
Click to hide internal directories.