pagination

package
v1.1.12 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 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