pagination

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 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"`
	Paging shared.Paging `json:"paging,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 ResponsesPage

type ResponsesPage[T any] struct {
	Responses []T               `json:"responses"`
	JSON      responsesPageJSON `json:"-"`
	// contains filtered or unexported fields
}

func (*ResponsesPage[T]) GetNextPage

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

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

func (*ResponsesPage[T]) UnmarshalJSON

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

type ResponsesPageAutoPager

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

func NewResponsesPageAutoPager

func NewResponsesPageAutoPager[T any](page *ResponsesPage[T], err error) *ResponsesPageAutoPager[T]

func (*ResponsesPageAutoPager[T]) Current

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

func (*ResponsesPageAutoPager[T]) Err

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

func (*ResponsesPageAutoPager[T]) Index

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

func (*ResponsesPageAutoPager[T]) Next

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

type SinglePage

type SinglePage[T any] struct {
	Items []T            `json:"-,inline"`
	JSON  singlePageJSON `json:"-"`
	// contains filtered or unexported fields
}

func (*SinglePage[T]) GetNextPage

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

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

func (*SinglePage[T]) UnmarshalJSON

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

type SinglePageAutoPager

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

func NewSinglePageAutoPager

func NewSinglePageAutoPager[T any](page *SinglePage[T], err error) *SinglePageAutoPager[T]

func (*SinglePageAutoPager[T]) Current

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

func (*SinglePageAutoPager[T]) Err

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

func (*SinglePageAutoPager[T]) Index

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

func (*SinglePageAutoPager[T]) Next

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

Jump to

Keyboard shortcuts

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