pager

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateCurrentPage

func CalculateCurrentPage(page int64) int64

func CalculateLimitOffset

func CalculateLimitOffset(page, elements int64) (offset, limit int64)

func CalculateRemaining

func CalculateRemaining(total, page, elements int64) int64

func CalculateTotal

func CalculateTotal(limit, count int64) int64

func HasAnyElements

func HasAnyElements(page, elements, count int64) bool

func ValidatePageElements

func ValidatePageElements(page, elements *int64) error

Types

type PageSet

type PageSet[T any] struct {
	Page     int64 `json:"page"`
	Elements int64 `json:"elements"`
	Count    int64 `json:"count"`
	Data     T
}

Jump to

Keyboard shortcuts

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