pagination

package
v1.48.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cursor

type Cursor[T any] struct {
	Items      []T              `json:"items"`
	Pagination CursorPagination `json:"pagination,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Items       respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	// contains filtered or unexported fields
}

func (*Cursor[T]) GetNextPage

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

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

Returns the unmodified JSON received from the API

func (*Cursor[T]) SetPageConfig

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

func (*Cursor[T]) UnmarshalJSON

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

type CursorAutoPager

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

func NewCursorAutoPager

func NewCursorAutoPager[T any](page *Cursor[T], err error) *CursorAutoPager[T]

func (*CursorAutoPager[T]) Current

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

func (*CursorAutoPager[T]) Err

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

func (*CursorAutoPager[T]) Index

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

func (*CursorAutoPager[T]) Next

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

type CursorPagination

type CursorPagination struct {
	NextCursor     string `json:"next_cursor,nullable"`
	PreviousCursor string `json:"previous_cursor,nullable"`
	TotalCount     int64  `json:"total_count"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		NextCursor     respjson.Field
		PreviousCursor respjson.Field
		TotalCount     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CursorPagination) RawJSON

func (r CursorPagination) RawJSON() string

Returns the unmodified JSON received from the API

func (*CursorPagination) UnmarshalJSON

func (r *CursorPagination) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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