pagination

package
v0.0.0-...-d5dcd45 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package pagination provides pagination.

Index

Constants

View Source
const (
	// DefaultLimit is a default limit for pagination.
	DefaultLimit = 20
	// MaxLimit is a max limit for pagination.
	MaxLimit = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type List

type List[T any] struct {
	Result  []T  `json:"result"`
	HasNext bool `json:"has_next"`
}

List is a list of pagination.

func NewList

func NewList[T any](objectList []T, limit uint64) List[T]

NewList returns a new list of pagination.

type Params

type Params struct {
	Limit  uint64 `json:"limit"`
	Offset uint64 `json:"offset"`
}

Params is a params for pagination.

Jump to

Keyboard shortcuts

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