pagination

package module
v0.0.0-...-ae2a731 Latest Latest
Warning

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

Go to latest
Published: May 12, 2018 License: MIT Imports: 1 Imported by: 0

README

A Golang simple pagination libary

Software License Travis Go Doc


pagination

Simple function to fill page numbers for pagination bar.

Installation

go get -u github.com/a5i/pagination

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePagination

func GeneratePagination(currentPage, totalPages, boundaries, around int) []string

GeneratePagination generates a footer pagination so the user can navigate through the web app.

  • currentPage - actual page
  • totalPages - total available pages
  • boundaries - how many pages we want to link in the beginning and in the end
  • around - how many pages we want to link before and after the actual page

It checks and fixes wrong values. Why? We want to generate anyway in any case. I think we can add error value or log wrong parameters but stay it for future. It returns an array of page numbers and skipped pages "...". Why array? We want to render result in application and style the pagination.

Types

This section is empty.

Jump to

Keyboard shortcuts

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