pagination

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pagination

type Pagination[T any] struct {
	Data       []T                  `json:"data"`
	Pagination PaginationPagination `json:"pagination"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	// contains filtered or unexported fields
}

func (*Pagination[T]) GetNextPage

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

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

Returns the unmodified JSON received from the API

func (*Pagination[T]) SetPageConfig

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

func (*Pagination[T]) UnmarshalJSON

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

type PaginationAutoPager

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

func NewPaginationAutoPager

func NewPaginationAutoPager[T any](page *Pagination[T], err error) *PaginationAutoPager[T]

func (*PaginationAutoPager[T]) Current

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

func (*PaginationAutoPager[T]) Err

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

func (*PaginationAutoPager[T]) Index

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

func (*PaginationAutoPager[T]) Next

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

type PaginationPagination

type PaginationPagination struct {
	HasNext bool  `json:"has_next"`
	Page    int64 `json:"page"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		HasNext     respjson.Field
		Page        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PaginationPagination) RawJSON

func (r PaginationPagination) RawJSON() string

Returns the unmodified JSON received from the API

func (*PaginationPagination) UnmarshalJSON

func (r *PaginationPagination) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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