pagination

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Page

type Page[T any] struct {
	Page    int `json:"page"`
	Size    int `json:"size"`
	Content []T `json:"content"`
	Total   int `json:"total"`
}

func Collect added in v0.0.2

func Collect[T any](it iter.Seq[T], pageRequest PageRequest) Page[T]

func NewPage

func NewPage[T any](page int, size int, content []T, total int) Page[T]

type PageRequest

type PageRequest struct {
	Page int `json:"page" minimum:"0"`
	Size int `json:"size" minimum:"-1"`
}

func NewPageRequest

func NewPageRequest(page int, size int) PageRequest

NewPageRequest create a page request of the given size page the number of the page, starting at 0 size the size of the page

Jump to

Keyboard shortcuts

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