Documentation
¶
Overview ¶
Package tome was designed to paginate simple RESTful APIs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chapter ¶
type Chapter struct {
// API base URL.
BaseURL string `json:"base_url,omitempty"`
// The next URL link with page number.
NextURL string `json:"next_url,omitempty"`
// The previous URL link with page number.
PreviousURL string `json:"prev_url,omitempty"`
// Whether to create links or not.
Links bool `json:"-"`
// The inicial offset position.
Offset int `json:"-"`
// Limit per page.
Limit int `json:"per_page"`
// The page number captured on the request params.
NewPage int `json:"-"`
// Current page of the tome.
CurrentPage int `json:"current_page"`
// The last page of the tome.
LastPage int `json:"last_page"`
// Total of results, this usually comes from a SQL query total rows result.
TotalResults int `json:"total_results"`
}
Chapter type is a struct for pagination results.
Click to show internal directories.
Click to hide internal directories.
