pagination

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 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 added in v0.3.0

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

func FromLimit added in v0.3.0

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

func IndexRange added in v0.3.0

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

func PageOffsetLimit added in v0.3.0

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

func PagePerPage added in v0.3.0

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

func Paginate added in v0.3.0

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 added in v0.3.0

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

func SetPageCRM added in v0.3.0

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

func SignPageContext added in v0.3.0

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

Types

type PageState added in v0.3.0

type PageState struct {
	Offset  int
	PageNum int
	Token   string
}

func HasMoreBooks added in v0.3.0

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

func HasMoreByCount added in v0.3.0

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

func HasMoreCRM added in v0.3.0

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

func HasMoreProjects added in v0.3.0

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

func HasMoreSign added in v0.3.0

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

func HasMoreWorkDrive added in v0.3.0

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

type PaginationConfig added in v0.3.0

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