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 ¶
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]) SetPageConfig ¶
func (r *Cursor[T]) SetPageConfig(cfg *requestconfig.RequestConfig, res *http.Response)
func (*Cursor[T]) UnmarshalJSON ¶
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
Click to show internal directories.
Click to hide internal directories.