Expose folder pagination metadata

Merged
RO
2mo ago
+128-3

Summary

  • add Folders().GetPage alongside the existing source-compatible Get
  • expose HEY's X-Total-Count and opaque rel="next" page cursor
  • keep pagination requests on the configured origin by returning only the cursor for generated GetFolder calls

This unblocks complete folder traversal in hey-cli's CLI and TUI.

Basecamp card: https://app.basecamp.com/2914079/buckets/48521764/card_tables/cards/10206892850

Validation

  • GOWORK=off make check — pass (146 conformance cases)
  • GOWORK=off go test -race -count=1 ./pkg/hey — pass
  • git diff --check — pass
  • independent review — no blocking/P2 findings

Summary by cubic

Expose folder pagination so clients can traverse folders completely. Old: Folders().Get returned a folder page without pagination info. New: add Folders().GetPage that returns the folder plus TotalCount and a NextPage cursor; Get now delegates to GetPage and still returns only the folder.

  • Introduces FolderPage with Folder, NextPage, and TotalCount.
  • Adds FoldersService.GetPage(...); parses X-Total-Count and Link, returning only the page cursor to keep pagination on the configured origin.
  • Updates FoldersService.Get to call GetPage and return Folder; signature and behavior remain unchanged.
  • Migration: To paginate, call GetPage and iterate using NextPage; no changes required for existing Get usage.