pagination

package
v1.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFirstAndLastPages

func GetFirstAndLastPages(req *http.Request, totalPages int) []coreModel.PageToDisplay

GetFirstAndLastPages returns the first and last pages of a paginated results

func GetOffset

func GetOffset(pageSize, pageNo int) int

GetOffset returns the offset (0 based) into a list, given a page number (1 based) and the size of a page. A pageSize <= 0 or a pageNo <= 0 will give an offset of 0

func GetPagesToDisplay

func GetPagesToDisplay(currentPage, totalPages int, req *http.Request) []coreModel.PageToDisplay

GetPagesToDisplay returns the pages to be displayed within the first and last pages

func GetTotalPages

func GetTotalPages(totalCount, pageSize int) int

GetTotalPages returns the total pages from the total results count and pagesize parameters

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL