pagination

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT 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 BidirectionalPageCursor

type BidirectionalPageCursor[T any] struct {
	HasMore bool   `json:"has_more"`
	FirstID string `json:"first_id"`
	LastID  string `json:"last_id"`

	Data     []T    `json:"data"`
	NextPage string `json:"next_page" api:"nullable"`
	PrevPage string `json:"prev_page" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		HasMore respjson.Field
		FirstID respjson.Field
		LastID  respjson.Field

		Data        respjson.Field
		NextPage    respjson.Field
		PrevPage    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	// contains filtered or unexported fields
}

func (*BidirectionalPageCursor[T]) GetNextPage

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

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

Returns the unmodified JSON received from the API

func (*BidirectionalPageCursor[T]) SetPageConfig

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

func (*BidirectionalPageCursor[T]) UnmarshalJSON

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

type BidirectionalPageCursorAutoPager

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

func NewBidirectionalPageCursorAutoPager

func NewBidirectionalPageCursorAutoPager[T any](page *BidirectionalPageCursor[T], err error) *BidirectionalPageCursorAutoPager[T]

func (*BidirectionalPageCursorAutoPager[T]) Current

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

func (*BidirectionalPageCursorAutoPager[T]) Err

func (*BidirectionalPageCursorAutoPager[T]) Index

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

func (*BidirectionalPageCursorAutoPager[T]) Next

type Page

type Page[T any] struct {
	Data    []T    `json:"data"`
	HasMore bool   `json:"has_more"`
	FirstID string `json:"first_id" api:"nullable"`
	LastID  string `json:"last_id" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		FirstID     respjson.Field
		LastID      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

type PageCursor

type PageCursor[T any] struct {
	HasMore bool   `json:"has_more"`
	FirstID string `json:"first_id"`
	LastID  string `json:"last_id"`

	Data     []T    `json:"data"`
	NextPage string `json:"next_page" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		HasMore respjson.Field
		FirstID respjson.Field
		LastID  respjson.Field

		Data        respjson.Field
		NextPage    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	// contains filtered or unexported fields
}

func (*PageCursor[T]) GetNextPage

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

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

Returns the unmodified JSON received from the API

func (*PageCursor[T]) SetPageConfig

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

func (*PageCursor[T]) UnmarshalJSON

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

type PageCursorAutoPager

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

func NewPageCursorAutoPager

func NewPageCursorAutoPager[T any](page *PageCursor[T], err error) *PageCursorAutoPager[T]

func (*PageCursorAutoPager[T]) Current

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

func (*PageCursorAutoPager[T]) Err

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

func (*PageCursorAutoPager[T]) Index

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

func (*PageCursorAutoPager[T]) Next

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

type TokenPage

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

func (*TokenPage[T]) GetNextPage

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

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

Returns the unmodified JSON received from the API

func (*TokenPage[T]) SetPageConfig

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

func (*TokenPage[T]) UnmarshalJSON

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

type TokenPageAutoPager

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

func NewTokenPageAutoPager

func NewTokenPageAutoPager[T any](page *TokenPage[T], err error) *TokenPageAutoPager[T]

func (*TokenPageAutoPager[T]) Current

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

func (*TokenPageAutoPager[T]) Err

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

func (*TokenPageAutoPager[T]) Index

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

func (*TokenPageAutoPager[T]) Next

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

Jump to

Keyboard shortcuts

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