paginate

package
v1.18.0-renovate-codec... Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Template string

Functions

func GetRequestedElementsPerPage

func GetRequestedElementsPerPage(valueFromUrl string, perPageOptions []int) int

func GetRequestedPage

func GetRequestedPage(valueFromUrl string) int

Types

type Pagination

type Pagination struct {
	CurrentPage     int
	TotalPages      int
	TotalElements   int
	ElementsPerPage int
	ElementName     string
	PerPageOptions  []int
	UrlBuilder      UrlBuilder
}

func (Pagination) GetElementsFrom

func (p Pagination) GetElementsFrom() int

func (Pagination) GetElementsTo

func (p Pagination) GetElementsTo() int

func (Pagination) GetNextUrl

func (p Pagination) GetNextUrl() string

func (Pagination) GetPageNumbers

func (p Pagination) GetPageNumbers() []int

func (Pagination) GetPreviousUrl

func (p Pagination) GetPreviousUrl() string

func (Pagination) ShowEllipsisBetween

func (p Pagination) ShowEllipsisBetween(page1 int, page2 int) bool

func (Pagination) ShowNext

func (p Pagination) ShowNext() bool

func (Pagination) ShowPrevious

func (p Pagination) ShowPrevious() bool

type UrlBuilder

type UrlBuilder interface {
	GetPaginationUrl(int, ...int) string
}

Jump to

Keyboard shortcuts

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