pagination

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPage  = 1
	DefaultLimit = 10
	MaxLimit     = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pagination

type Pagination struct {
	Page       int  `json:"page" required:"true" nullable:"false"`
	Limit      int  `json:"limit" required:"true" nullable:"false"`
	Total      int  `json:"total" required:"true" nullable:"false"`
	TotalPages int  `json:"total_pages" required:"true" nullable:"false"`
	HasMore    bool `json:"has_more" required:"true" nullable:"false"`
}

func New

func New(page, limit, total int) Pagination

type Params

type Params struct {
	Page  int
	Limit int
}

func Clamp

func Clamp(params Params) Params

func ParseFromRequest

func ParseFromRequest(r *http.Request) Params

Jump to

Keyboard shortcuts

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