store

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect[T any](ctx context.Context, getPage GetPageFunc[T]) ([]T, error)

Types

type GetPageFunc

type GetPageFunc[T any] func(ctx context.Context, options PaginationConfig) (Page[T], error)

type Page

type Page[T any] struct {
	Cursor  *string
	Results []T
}

Page is a generic type representing a paginated response from the store.

type PaginationConfig

type PaginationConfig struct {
	// Cursor is an optional string that indicates where to start the page. This
	// is typically the ID of the last item from the previous page.
	Cursor *string
	// Limit is an optional integer that specifies the maximum number of items to
	// return in the page. If not provided, a default limit may be applied by the
	// implementation.
	Limit *int
}

Jump to

Keyboard shortcuts

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