Skip to content

Wire list and image ops against the Lorem Picsum API#1

Merged
tamnd merged 2 commits into
mainfrom
feat/list-image-ops
Jun 14, 2026
Merged

Wire list and image ops against the Lorem Picsum API#1
tamnd merged 2 commits into
mainfrom
feat/list-image-ops

Conversation

@tamnd

@tamnd tamnd commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace scaffold Page/GetPage/PageLinks with real Image struct and Config/NewClient backed by the Lorem Picsum JSON API
  • Add list op (GET /v2/list?page=&limit=) with --page and --limit flags
  • Add image op (GET /id/{id}/info) that resolves a single image by numeric id
  • Full httptest coverage: parse, path routing, User-Agent header, and retry on 5xx

Test plan

  • go test ./... passes (7 tests, all offline via httptest)
  • ./bin/picsum list --limit 5 returns 5 JSON records from picsum.photos
  • ./bin/picsum image 42 returns Luke Chesser's image metadata
  • ./bin/picsum image 0 returns image 0 metadata

tamnd added 2 commits June 15, 2026 04:14
Replace scaffold placeholders with real Config/Client and two operations:
list (GET /v2/list, paginated) and image (GET /id/{id}/info). Add httptest
coverage for both methods plus User-Agent and retry behaviour.
gofmt requires consistent field alignment when some fields are wider
than others; the Resolver field made Args need an extra space.
@tamnd tamnd merged commit 1e7381a into main Jun 14, 2026
7 checks passed
@tamnd tamnd deleted the feat/list-image-ops branch June 14, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant