Documentation
¶
Overview ¶
Package idempotencytest provides reusable adapter conformance and fixtures.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunStoreConformance ¶
func RunStoreConformance(t *testing.T, factory StoreFactory)
RunStoreConformance proves shared ownership, fencing, and replay behavior.
Types ¶
type Clock ¶
type Clock struct {
// contains filtered or unexported fields
}
Clock is a concurrency-safe deterministic clock for store tests.
type StoreFactory ¶
type StoreFactory func(testing.TB) StoreFixture
StoreFactory constructs a fresh fixture for one conformance subtest.
type StoreFixture ¶
type StoreFixture struct {
// Store is the backend instance under test.
Store idempotency.Store
// Key identifies the shared operation used by the conformance cases.
Key idempotency.Key
// Fingerprint identifies the shared business request used by the cases.
Fingerprint idempotency.Fingerprint
// Advance moves authoritative backend time when the fixture supports it.
Advance func(time.Duration)
}
StoreFixture supplies an isolated backend and deterministic identities.
type TokenSource ¶
type TokenSource struct {
// contains filtered or unexported fields
}
TokenSource emits deterministic unique ownership tokens for tests.
func NewTokenSource ¶
func NewTokenSource(prefix string) *TokenSource
NewTokenSource constructs a token source using prefix.
func (*TokenSource) Next ¶
func (s *TokenSource) Next() (string, error)
Next returns the next deterministic token.
Click to show internal directories.
Click to hide internal directories.