pagination

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gettable

type Gettable interface {
	// For example, url.Values
	Get(string) string
}

type Paginatable

type Paginatable interface {
	Pages() []int
	Page() QueryPage
	Values() url.Values
	NextPage() url.Values
	PrevPage() url.Values
}

type Pagination

type Pagination struct {
	Limit           int
	Skip            int
	DefaultPageSize int
}

func (Pagination) GivenPage

func (this Pagination) GivenPage(pageNum int) QueryPage

func (Pagination) NextPage

func (this Pagination) NextPage() url.Values

func (Pagination) Page

func (this Pagination) Page() QueryPage

func (Pagination) Pages

func (this Pagination) Pages() []int

func (*Pagination) Paginate

func (this *Pagination) Paginate(form Gettable)

func (Pagination) PaginationQuery

func (this Pagination) PaginationQuery() string

func (Pagination) PrevPage

func (this Pagination) PrevPage() url.Values

func (Pagination) Values

func (this Pagination) Values() url.Values

type QueryPage

type QueryPage struct {
	Number int
	Values url.Values
}

Jump to

Keyboard shortcuts

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