Documentation
¶
Index ¶
- type BidirectionalPageCursor
- func (r *BidirectionalPageCursor[T]) GetNextPage() (res *BidirectionalPageCursor[T], err error)
- func (r BidirectionalPageCursor[T]) RawJSON() string
- func (r *BidirectionalPageCursor[T]) SetPageConfig(cfg *requestconfig.RequestConfig, res *http.Response)
- func (r *BidirectionalPageCursor[T]) UnmarshalJSON(data []byte) error
- type BidirectionalPageCursorAutoPager
- type Page
- type PageAutoPager
- type PageCursor
- type PageCursorAutoPager
- type TokenPage
- type TokenPageAutoPager
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 (r *BidirectionalPageCursorAutoPager[T]) Err() error
func (*BidirectionalPageCursorAutoPager[T]) Index ¶
func (r *BidirectionalPageCursorAutoPager[T]) Index() int
func (*BidirectionalPageCursorAutoPager[T]) Next ¶
func (r *BidirectionalPageCursorAutoPager[T]) Next() bool
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 ¶
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]) SetPageConfig ¶
func (r *Page[T]) SetPageConfig(cfg *requestconfig.RequestConfig, res *http.Response)
func (*Page[T]) UnmarshalJSON ¶
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"` Total int64 `json:"total" api:"nullable"` 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 Total 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 NewSearchPage ¶ added in v0.12.0
func NewSearchPage[T any](ctx context.Context, path string, params any, opts ...option.RequestOption) (res *PageCursor[T], err error)
NewSearchPage sends a resource search with the required Beta header and JSON body pagination.
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 ¶
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]) SetPageConfig ¶
func (r *TokenPage[T]) SetPageConfig(cfg *requestconfig.RequestConfig, res *http.Response)
func (*TokenPage[T]) UnmarshalJSON ¶
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