Documentation
¶
Overview ¶
Package paging holds the cursor-pagination helpers shared by every domain that walks a Control Tower list RPC. It lives outside internal/cmd because sibling command packages must not import each other.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPaginationRequest ¶
func NewPaginationRequest(pageSize uint32, pageToken string) *messagescontroltowerv1.PaginationRequest
NewPaginationRequest builds a PaginationRequest, leaving zero values unset so the server applies its defaults.
func Paginate ¶
func Paginate( ctx context.Context, label string, fetch func(ctx context.Context, pageToken string) (string, error), ) error
Paginate walks a cursor-paginated list RPC until the server stops handing out a next page token. fetch receives the current page token and returns the next one. Returning an empty token from fetch also stops the walk, which lets a caller finish early once it has everything it needs. The repeated-token guard keeps a server that cycles tokens from looping forever.
Types ¶
This section is empty.