pagination

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PageNumber

type PageNumber[T any] struct {
	Items []T   `json:"items"`
	Total int64 `json:"total"`
	Page  int64 `json:"page"`
	Size  int64 `json:"size"`
	Pages int64 `json:"pages"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Items       respjson.Field
		Total       respjson.Field
		Page        respjson.Field
		Size        respjson.Field
		Pages       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	// contains filtered or unexported fields
}

func (*PageNumber[T]) GetNextPage

func (r *PageNumber[T]) GetNextPage() (res *PageNumber[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 (PageNumber[T]) RawJSON

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

Returns the unmodified JSON received from the API

func (*PageNumber[T]) SetPageConfig

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

func (*PageNumber[T]) UnmarshalJSON

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

type PageNumberAutoPager

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

func NewPageNumberAutoPager

func NewPageNumberAutoPager[T any](page *PageNumber[T], err error) *PageNumberAutoPager[T]

func (*PageNumberAutoPager[T]) Current

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

func (*PageNumberAutoPager[T]) Err

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

func (*PageNumberAutoPager[T]) Index

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

func (*PageNumberAutoPager[T]) Next

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

Jump to

Keyboard shortcuts

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