pagination

package
v0.0.0-...-4318582 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pagination

type Pagination struct {
	Offset    int64
	PageSize  int64
	SortOrder string
	SortBy    string
}

Pagination definition.

func BuildPagination

func BuildPagination(page, pageSize int64, sortOrder, sortBy string) *Pagination

BuildPagination create a new *Pagination.

func FirstPage

func FirstPage() *Pagination

FirstPage return a *Pagination with default values offset and page size.

func (*Pagination) GetSortInt

func (p *Pagination) GetSortInt() int

GetSortInt mapping to mongodb sort values.

func (*Pagination) SetOffset

func (p *Pagination) SetOffset(offset int64) *Pagination

SetOffset set the Offset field of the Pagination struct.

func (*Pagination) SetPage

func (p *Pagination) SetPage(page int64) *Pagination

SetPage set the Page field of the Pagination struct.

func (*Pagination) SetPageSize

func (p *Pagination) SetPageSize(limit int64) *Pagination

SetPageSize set the PageSize field of the Pagination struct.

func (*Pagination) SetSortBy

func (p *Pagination) SetSortBy(by string) *Pagination

SetSortBy set the SortBy field of the Pagination struct.

func (*Pagination) SetSortOrder

func (p *Pagination) SetSortOrder(order string) *Pagination

SetSortOrder set the SortOrder field of the Pagination struct.

Jump to

Keyboard shortcuts

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