pagination

package
v0.129.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPage defines the default page number
	DefaultPage = 1
	// DefaultPageSize defines the default number of items per page
	// TODO: change to 15 when all clients are updated
	DefaultPageSize = 50
)

Variables

This section is empty.

Functions

func IsOffsetPaginationError

func IsOffsetPaginationError(err error) bool

IsOffsetPaginationError checks if the error is an OffsetPaginationError

Types

type OffsetPaginationError

type OffsetPaginationError struct {
	// contains filtered or unexported fields
}

OffsetPaginationError is the error type for page-based pagination

func NewOffsetPaginationErrorStr

func NewOffsetPaginationErrorStr(errMsg string) OffsetPaginationError

NewOffsetPaginationErrorStr creates a new OffsetPaginationError with the provided error message

func (OffsetPaginationError) Error

func (e OffsetPaginationError) Error() string

Error returns the error message

func (OffsetPaginationError) Unwrap

func (e OffsetPaginationError) Unwrap() error

Unwrap returns the wrapped error

type OffsetPaginationOpts

type OffsetPaginationOpts struct {
	// contains filtered or unexported fields
}

OffsetPaginationOpts is the options for page-based pagination

func NewDefaultOffsetPaginationOpts

func NewDefaultOffsetPaginationOpts() *OffsetPaginationOpts

NewDefaultOffsetPaginationOpts creates a new OffsetPaginationOpts with default values

func NewOffsetPaginationOpts

func NewOffsetPaginationOpts(offset, limit int) (*OffsetPaginationOpts, error)

NewOffsetPaginationOpts creates a new OffsetPaginationOpts with the provided page and pageSize

func (*OffsetPaginationOpts) Limit

func (o *OffsetPaginationOpts) Limit() int

Limit returns the number of items per page

func (*OffsetPaginationOpts) Offset

func (o *OffsetPaginationOpts) Offset() int

Offset returns the page number

Jump to

Keyboard shortcuts

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