You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(client): add BatchSet, BatchGet, and BatchDelete operations
Introduce three new methods on *Client that execute their respective
operations in a single HTTP round-trip against the existing
POST /v1/cache/batch/{put,get,delete} wire endpoints.
Key design points:
- Per-item granularity: the outer error fires only on transport/auth/
HTTP-level failures; individual item failures surface via the result's
Err field (*StatusError), preserving errors.Is/errors.As compatibility
with the single-key sentinel set.
- BatchGet treats missing keys as Found=false, not an error.
- Empty input is a client-side no-op (returns empty slice, nil error)
without dispatching an HTTP request.
- Results mirror input order (index i of result = outcome for input i).
Supporting changes:
- Extract contentTypeJSON const to eliminate drift between call sites.
- Add test_consts_test.go with shared JSON wire-key constants.
- Eight new test cases in batch_test.go covering happy paths, per-item
failures, mixed found/missing, empty-input no-ops, and HTTP-level
failure wrapping ErrAllEndpointsFailed.
- Extend docs/client-sdk.md with a dedicated Batch operations section
and update the commands reference table with the three new methods.
- Add a BatchSet demo step to the distributed-oidc-client example.
- Fix markdown anchor links in docs/oncall.md (double-dash → single-dash).
- Bump softprops/action-gh-release v2 → v3 in release.yml.
0 commit comments