pagination

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PaginationRequest

type PaginationRequest struct {
	Page     uint64
	PageSize uint64
}

func New

func New(page, pageSize int32) *PaginationRequest

New creates a new pagination request from the page and page size.

func NewRequest

func NewRequest(page, pageSize int32) PaginationRequest

NewRequest creates a new pagination request (not pointer) from the page and page size

func Start

func Start(pageSize ...int32) *PaginationRequest

Start creates a new PaginationRequest that starts at the first page. You can provide an optional pageSize argument. If none is provided, 15 is used. All arguments apart from the first one are ignored.

func (*PaginationRequest) Advance

func (pr *PaginationRequest) Advance() *PaginationRequest

Advance returns a new pagination request with the page incremented by 1

func (*PaginationRequest) ApplyToSelect

func (*PaginationRequest) CalculatePages

func (pr *PaginationRequest) CalculatePages(count int) int32

func (*PaginationRequest) Offset

func (pr *PaginationRequest) Offset() uint64

Jump to

Keyboard shortcuts

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