pagination

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPage    = 1
	DefaultPerPage = 25
	MaxPerPage     = 100
)

Variables

This section is empty.

Functions

func Meta

func Meta(page Page, total int64) map[string]any

Types

type Page

type Page struct {
	Page    int `json:"page"`
	PerPage int `json:"per_page"`
	Offset  int `json:"offset"`
	Limit   int `json:"limit"`
}

func Parse

func Parse(values url.Values) Page

Parse converts query values into a bounded page description. per_page takes precedence over limit when both are present.

Jump to

Keyboard shortcuts

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