page

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 2 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] interface {
	Paginated

	Items() []T
}

func Empty

func Empty[T any]() Page[T]

func New

func New[T any](content []T, pageable Pageable, total int) Page[T]

func WithContent

func WithContent[T any](content []T) Page[T]

type Pageable

type Pageable interface {
	PageNumber() int
	PageSize() int
	Offset() int
	Sort() sort.Sort
	IsPaged() bool
	IsUnpaged() bool
	First() Pageable
	HasPrevious() bool
	Next() Pageable
	PreviousOrFirst() Pageable
}

func Of

func Of(pageNumber, pageSize int) Pageable

func OfSize

func OfSize(pageSize int) Pageable

func Unpaged

func Unpaged() Pageable

type Paginated

type Paginated interface {
	TotalPages() int
	TotalElements() int
	HasNext() bool
	Number() int
	Size() int
	NumberOfElements() int
	HasPrevious() bool
	IsFirst() bool
	IsLast() bool
	NextPageable() Pageable
	PreviousPageable() Pageable
	HasContent() bool
	Content() any
	Pageable() Pageable
	Sort() sort.Sort
}

Jump to

Keyboard shortcuts

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