pagination

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OffsetPage

type OffsetPage[T any] struct {
	Results []T   `json:"results"`
	Count   int64 `json:"count"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Results     respjson.Field
		Count       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	// contains filtered or unexported fields
}

func (*OffsetPage[T]) GetNextPage

func (r *OffsetPage[T]) GetNextPage() (res *OffsetPage[T], err error)

GetNextPage returns the next page as defined by this pagination style. When there is no next page, this function will return a 'nil' for the page value, but will not return an error

func (OffsetPage[T]) RawJSON

func (r OffsetPage[T]) RawJSON() string

Returns the unmodified JSON received from the API

func (*OffsetPage[T]) SetPageConfig

func (r *OffsetPage[T]) SetPageConfig(cfg *requestconfig.RequestConfig, res *http.Response)

func (*OffsetPage[T]) UnmarshalJSON

func (r *OffsetPage[T]) UnmarshalJSON(data []byte) error

type OffsetPageAutoPager

type OffsetPageAutoPager[T any] struct {
	// contains filtered or unexported fields
}

func NewOffsetPageAutoPager

func NewOffsetPageAutoPager[T any](page *OffsetPage[T], err error) *OffsetPageAutoPager[T]

func (*OffsetPageAutoPager[T]) Current

func (r *OffsetPageAutoPager[T]) Current() T

func (*OffsetPageAutoPager[T]) Err

func (r *OffsetPageAutoPager[T]) Err() error

func (*OffsetPageAutoPager[T]) Index

func (r *OffsetPageAutoPager[T]) Index() int

func (*OffsetPageAutoPager[T]) Next

func (r *OffsetPageAutoPager[T]) Next() bool

Jump to

Keyboard shortcuts

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