Documentation
¶
Overview ¶
Package storetest holds the behavioural contract every MessageStore backend must satisfy, so the backends can be proven to agree rather than merely to each work.
Agreement is the property that actually matters for replay. A resume cursor is issued by whichever node served the previous connection and redeemed by whichever node serves the next one, and in a load-balanced deployment those are routinely different processes — potentially running different backends during a migration. If "sequence 7" means one message in the local store and another in Redis, a reconnecting client is silently handed the wrong slice of history, and nothing in either backend's own test suite would catch it.
Written as an exported suite rather than duplicated per backend for the same reason: two copies of a contract drift, and the drift is invisible until it reaches production.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunMessageStoreContract ¶
func RunMessageStoreContract(t *testing.T, newStore NewMessageStore)
RunMessageStoreContract asserts the sequencing and replay behaviour every backend must provide.
Types ¶
type NewMessageStore ¶
type NewMessageStore func(t *testing.T) streaming.MessageStore
NewMessageStore builds a connected, empty store for one test.