Help us shape the future of Go! Take the 2026 Go Developer Survey

pagination

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractItems

func ExtractItems(raw json.RawMessage, key string) []json.RawMessage

func FromLimit

func FromLimit(pageSize int) func(*PageState, map[string]string)

func IndexRange

func IndexRange(pageSize int) func(*PageState, map[string]string)

func PageOffsetLimit

func PageOffsetLimit(pageSize int) func(*PageState, map[string]string)

func PagePerPage

func PagePerPage(pageSize int) func(*PageState, map[string]string)

func Paginate

func Paginate(ctx context.Context, cfg PaginationConfig) ([]json.RawMessage, error)

func PaginateCRM

func PaginateCRM(ctx context.Context, client *zohttp.Client, url string, params map[string]string, maxPages int) ([]json.RawMessage, error)

func PaginateProjects

func PaginateProjects(ctx context.Context, client *zohttp.Client, url string, itemsKey string, params map[string]string, maxPages int) ([]json.RawMessage, error)

func PaginateWorkDrive

func PaginateWorkDrive(ctx context.Context, client *zohttp.Client, url string, params map[string]string, maxPages int) ([]json.RawMessage, error)

func SIndexLimit

func SIndexLimit(pageSize int) func(*PageState, map[string]string)

func SetPageCRM

func SetPageCRM(state *PageState, params map[string]string)

func SignPageContext

func SignPageContext(pageSize int) func(*PageState, map[string]string)

Types

type PageState

type PageState struct {
	Offset  int
	PageNum int
	Token   string
}

func HasMoreBooks

func HasMoreBooks(raw json.RawMessage, _ int, _ int) (bool, *PageState)

func HasMoreByCount

func HasMoreByCount(_ json.RawMessage, fetched int, pageSize int) (bool, *PageState)

func HasMoreCRM

func HasMoreCRM(raw json.RawMessage, _ int, _ int) (bool, *PageState)

func HasMoreProjects

func HasMoreProjects(raw json.RawMessage, _ int, _ int) (bool, *PageState)

func HasMoreSign

func HasMoreSign(raw json.RawMessage, _ int, _ int) (bool, *PageState)

func HasMoreWorkDrive

func HasMoreWorkDrive(raw json.RawMessage, _ int, _ int) (bool, *PageState)

type PaginationConfig

type PaginationConfig struct {
	Client   *zohttp.Client
	Method   string
	URL      string
	Opts     *zohttp.RequestOpts
	ItemsKey string
	PageSize int
	Limit    int
	SetPage  func(state *PageState, params map[string]string)
	HasMore  func(raw json.RawMessage, fetched int, pageSize int) (bool, *PageState)
}

Jump to

Keyboard shortcuts

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