statefulIdem is an in-memory idempotency store: first Claim of a key wins (Acquired), Complete caches the response, and a later Claim of the same key replays it. Enough to exercise the retry-replay path end to end.
| 20 | // (Acquired), Complete caches the response, and a later Claim of the same key |
| 21 | // replays it. Enough to exercise the retry-replay path end to end. |
| 22 | type statefulIdem struct { |
| 23 | mu sync.Mutex |
| 24 | cached map[string]idempotency.CachedResponse |
| 25 | inflight map[string]bool |
| 26 | } |
| 27 | |
| 28 | func newStatefulIdem() *statefulIdem { |
| 29 | return &statefulIdem{cached: map[string]idempotency.CachedResponse{}, inflight: map[string]bool{}} |
nothing calls this directly
no outgoing calls
no test coverage detected