pagination

package
v0.0.0-...-1eebd2c Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: EUPL-1.2 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDer

type IDer interface {
	GetID() uuid.UUID
}

type Pagination

type Pagination struct {
	FirstID *uuid.UUID `json:"firstId,omitempty"`
	LastID  *uuid.UUID `json:"lastId,omitempty"`
	PerPage int        `json:"perPage"`
}

func New

func New(moreThanPerPage bool, md *meta.Data, firstID, lastID uuid.UUID) *Pagination

type Response

type Response[T any] struct {
	Data       []T         `json:"data"`
	Pagination *Pagination `json:"pagination"`
}

func Build

func Build[T IDer](slice []T, md *meta.Data) (Response[T], error)

Jump to

Keyboard shortcuts

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