Documentation
¶
Overview ¶
Package pagination owns the bounded cursor walk shared by built-in and externally assembled commands.
Index ¶
Constants ¶
const CollectAllHardPageBound = 100
CollectAllHardPageBound caps complete-set collections. It is deliberately tighter than the user-facing --page-limit maximum (1000): such a collection holds every page in memory before the caller's writes run, so its upper bound is a host resource decision, not a display preference. Value from the extension design's Phase 0 (owner plan §8.3).
It lives here because the production host adapter and the commandtest recorder must enforce the same bound: a business command whose tests pass at 300 pages but fails in production at 101 is worse than one that fails in both.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CursorError ¶
type CursorError struct {
Kind CursorErrorKind
Page int
Token string
}
CursorError reports an invalid cursor transition.
func (*CursorError) Error ¶
func (e *CursorError) Error() string
type CursorErrorKind ¶
type CursorErrorKind uint8
CursorErrorKind identifies an invalid cursor transition returned by an API.
const ( // CursorMissing means the API reported another page without a cursor. CursorMissing CursorErrorKind = iota + 1 // CursorRepeated means the API returned a cursor already observed by the walk. CursorRepeated )
type Fetch ¶
type Fetch func(ctx context.Context, pageNumber int, pageToken string) (hasMore bool, nextToken string, err error)
Fetch obtains and consumes one page, then returns its cursor state.
type Options ¶
type Options struct {
InitialToken string
MaxPages int
Delay time.Duration
Fetch Fetch
Wait func(context.Context, time.Duration) error
}
Options configures one bounded cursor walk.