paginater: github.com/Unknwon/paginater Index | Files

package paginater

import "github.com/Unknwon/paginater"

Package paginater is a helper module for custom pagination calculation.

Index

Package Files

paginater.go

type Page Uses

type Page struct {
    // contains filtered or unexported fields
}

Page presents a page in the paginater.

func (*Page) IsCurrent Uses

func (p *Page) IsCurrent() bool

func (*Page) Num Uses

func (p *Page) Num() int

type Paginater Uses

type Paginater struct {
    // contains filtered or unexported fields
}

Paginater represents a set of results of pagination calculations.

func New Uses

func New(total, pagingNum, current, numPages int) *Paginater

New initialize a new pagination calculation and returns a Paginater as result.

func (*Paginater) Current Uses

func (p *Paginater) Current() int

Current returns current page number.

func (*Paginater) HasNext Uses

func (p *Paginater) HasNext() bool

HasNext returns true if there is a next page relative to current page.

func (*Paginater) HasPrevious Uses

func (p *Paginater) HasPrevious() bool

HasPrevious returns true if there is a previous page relative to current page.

func (*Paginater) IsFirst Uses

func (p *Paginater) IsFirst() bool

IsFirst returns true if current page is the first page.

func (*Paginater) IsLast Uses

func (p *Paginater) IsLast() bool

IsLast returns true if current page is the last page.

func (*Paginater) Next Uses

func (p *Paginater) Next() int

func (*Paginater) Pages Uses

func (p *Paginater) Pages() []*Page

Pages returns a list of nearby page numbers relative to current page. If value is -1 means "..." that more pages are not showing.

func (*Paginater) PagingNum Uses

func (p *Paginater) PagingNum() int

PagingNum returns number of page size.

func (*Paginater) Previous Uses

func (p *Paginater) Previous() int

func (*Paginater) Total Uses

func (p *Paginater) Total() int

Total returns number of total rows.

func (*Paginater) TotalPages Uses

func (p *Paginater) TotalPages() int

TotalPage returns number of total pages.

Package paginater is imported by 367 packages. Updated 2018-11-29. Refresh now. Tools for package owners.