pagination

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncResult

type AsyncResult[ApiRetT any, RespT any] struct {
	SyncResult[ApiRetT, RespT]
	Err error
}

type Basic

type Basic[ApiRetT any, RespT any] struct {
	// contains filtered or unexported fields
}

func New

func New[ApiRetT any, RespT any](fn interface{}, opts interface{}, optioner Optioner) *Basic[ApiRetT, RespT]

func (*Basic[ApiRetT, RespT]) Async

func (p *Basic[ApiRetT, RespT]) Async(params ...interface{}) <-chan AsyncResult[ApiRetT, RespT]

func (*Basic[ApiRetT, RespT]) Sync

func (p *Basic[ApiRetT, RespT]) Sync(params ...interface{}) (SyncResult[ApiRetT, RespT], error)

type MappedPager

type MappedPager[ApiRetT any, UserRetT any, RespT any] struct {
	Opts   interface{}
	Fn     interface{}
	Mapper func(ApiRetT) []UserRetT
	// contains filtered or unexported fields
}

func NewMapper

func NewMapper[ApiRetT any, UserRetT any, RespT any](fn interface{}, opts interface{}, mapper func(ApiRetT) []UserRetT, optioner Optioner) *MappedPager[ApiRetT, UserRetT, RespT]

func (*MappedPager[ApiRetT, UserRetT, RespT]) Async

func (p *MappedPager[ApiRetT, UserRetT, RespT]) Async(params ...interface{}) <-chan AsyncResult[UserRetT, RespT]

func (*MappedPager[ApiRetT, UserRetT, RespT]) Sync

func (p *MappedPager[ApiRetT, UserRetT, RespT]) Sync(params ...interface{}) (SyncResult[UserRetT, RespT], error)

type Optioner

type Optioner interface {
	Done(resp interface{}) bool
	Advance(resp interface{}, opts interface{})
	OptionsIndex(fnInputsCount int, isVariadic bool) int
}

type SyncResult

type SyncResult[ApiRetT any, RespT any] struct {
	Collected []ApiRetT
	Resp      RespT
}

Jump to

Keyboard shortcuts

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