Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultRetryConfig = RetryConfig{ MaxAttempts: 5, InitialBackoff: 200 * time.Millisecond, MaxBackoff: 5 * time.Second, BackoffMultiplier: 2.0, }
Functions ¶
func Paginate ¶ added in v0.6.0
func Paginate[Item any]( ctx context.Context, fetch func(ctx context.Context, token *string) (items []Item, next *string, err error), ) ([]Item, error)
Paginate calls fetch with the previous response's next token until the returned token is nil or empty. Returned items from each page are appended in order. fetch is responsible for any per-page retry/error formatting.
Types ¶
Click to show internal directories.
Click to hide internal directories.