pagination

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CursorPage

type CursorPage[T any] struct {
	Data    []T  `json:"data"`
	HasMore bool `json:"has_more"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	// contains filtered or unexported fields
}

func (*CursorPage[T]) GetNextPage

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

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

Returns the unmodified JSON received from the API

func (*CursorPage[T]) SetPageConfig

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

func (*CursorPage[T]) UnmarshalJSON

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

type CursorPageAutoPager

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

func NewCursorPageAutoPager

func NewCursorPageAutoPager[T any](page *CursorPage[T], err error) *CursorPageAutoPager[T]

func (*CursorPageAutoPager[T]) Current

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

func (*CursorPageAutoPager[T]) Err

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

func (*CursorPageAutoPager[T]) Index

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

func (*CursorPageAutoPager[T]) Next

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

type Page

type Page[T any] struct {
	Data   []T    `json:"data"`
	Object string `json:"object,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	// contains filtered or unexported fields
}

func (*Page[T]) GetNextPage

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

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

Returns the unmodified JSON received from the API

func (*Page[T]) SetPageConfig

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

func (*Page[T]) UnmarshalJSON

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

type PageAutoPager

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

func NewPageAutoPager

func NewPageAutoPager[T any](page *Page[T], err error) *PageAutoPager[T]

func (*PageAutoPager[T]) Current

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

func (*PageAutoPager[T]) Err

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

func (*PageAutoPager[T]) Index

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

func (*PageAutoPager[T]) Next

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

Jump to

Keyboard shortcuts

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