pagination

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Page

type Page[T any] struct {
	Data               []T                    `json:"data"`
	PaginationMetadata PagePaginationMetadata `json:"pagination_metadata,required"`
	JSON               pageJSON               `json:"-"`
	// contains filtered or unexported fields
}

func (*Page[T]) GetNextPage

func (r *Page[T]) GetNextPage() (res *Page[T], err error)

NextPage 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

func (r *Page[T]) UnmarshalJSON(data []byte) (err 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 PagePaginationMetadata

type PagePaginationMetadata struct {
	HasMore    bool                       `json:"has_more,required"`
	NextCursor string                     `json:"next_cursor,required,nullable"`
	JSON       pagePaginationMetadataJSON `json:"-"`
}

func (*PagePaginationMetadata) UnmarshalJSON

func (r *PagePaginationMetadata) UnmarshalJSON(data []byte) (err error)

Jump to

Keyboard shortcuts

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