pagination

package
v0.0.0-...-ebdf1d9 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2018 License: MIT Imports: 5 Imported by: 19

Documentation

Overview

Package pagination assists with navigating between pages of results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Map

func Map() template.FuncMap

Map returns a template.FuncMap PAGINATION which makes it easy to navigate between pages of results.

Types

type Info

type Info struct {
	Page       int
	TotalPages int
	PerPage    int
	Offset     int
}

Info holds the pagination fields.

func New

func New(r *http.Request, perPage int) *Info

New returns a pagination struct.

func (*Info) CalculatePages

func (i *Info) CalculatePages(itemTotal int)

CalculatePages calculates the number of pages by passing in the item total.

Jump to

Keyboard shortcuts

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