pagination

package
v0.0.0-...-5a6b2d2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithSimplePagination

func WithSimplePagination(ctx context.Context, sp *SimplePagination) context.Context

WithSimplePagination returns a new context with the given SimplePagination.

Types

type SimplePagination

type SimplePagination struct {
	CurrentIndex int
	PageIndex    int
}

SimplePagination is a simple pagination implementation.

func NewSimplePagination

func NewSimplePagination(p, c string) (sp *SimplePagination, err error)

NewSimplePagination creates a new SimplePagination from the given page and count. If both are empty, it returns nil.

func SimplePaginationFromContext

func SimplePaginationFromContext(ctx context.Context) (*SimplePagination, bool)

SimplePaginationFromContext returns the SimplePagination from the given context.

Jump to

Keyboard shortcuts

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