pagination

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pagination

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

Pagination stores pagination request data

func NewOffsetPagination

func NewOffsetPagination(page int64, limit int64) *Pagination

func (*Pagination) OffsetParams

func (pagination *Pagination) OffsetParams() *PaginationOffsetParams

func (*Pagination) OffsetResult

func (pagination *Pagination) OffsetResult(totalRecord int64) *PaginationResult

func (*Pagination) Type

func (pagination *Pagination) Type() PaginationType

type PaginationOffsetParams

type PaginationOffsetParams struct {
	Page  int64
	Limit int64
}

func (*PaginationOffsetParams) Offset

func (params *PaginationOffsetParams) Offset() int64

type PaginationOffsetResult

type PaginationOffsetResult struct {
	TotalRecord int64
	CurrentPage int64
	Limit       int64
}

func (*PaginationOffsetResult) TotalPage

func (result *PaginationOffsetResult) TotalPage() int64

type PaginationResult

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

func NewOffsetPaginationResult

func NewOffsetPaginationResult(totalRecord int64, currentPage int64, limit int64) *PaginationResult

func (*PaginationResult) OffsetResult

func (result *PaginationResult) OffsetResult() *PaginationOffsetResult

func (*PaginationResult) Type

func (result *PaginationResult) Type() PaginationType

type PaginationType

type PaginationType = string
const (
	PAGINATION_OFFSET PaginationType = "offset"
)

Jump to

Keyboard shortcuts

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