Documentation
¶
Overview ¶
Package storagetest provides a shared Ginkgo behavior suite every storage.Adapter implementation must pass. Both shipped adapters register it verbatim, and a new one does the same:
var _ = storagetest.Conformance("postgres", func() storage.Adapter { ... })
Index ¶
- func Catalog(name string, newAdapter func() storage.Adapter) bool
- func Conformance(name string, newAdapter func() storage.Adapter) bool
- func CursorState(name string, newAdapter func() storage.Adapter) bool
- func Leases(name string, newShared func() (a, b storage.Adapter, cleanup func())) bool
- func Replica(name string, newAdapter func() storage.Adapter) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Catalog ¶
Catalog registers the behavior specs for an adapter that implements storage.Catalog. Registered separately from Conformance because the capability is optional; an adapter without one does not call this. newAdapter is called per spec and must return a fresh, empty store; it is closed afterwards.
func Conformance ¶
Conformance registers the adapter behavior specs. newAdapter is called per spec and must return a fresh, empty store; it is closed afterwards.
func CursorState ¶
CursorState registers the behavior specs for an adapter that implements cursorstate.Provider. Registered separately from Conformance because the provider is optional; an adapter without one does not call this. newAdapter is called per spec and must return a fresh, empty store; it is closed afterwards.
func Leases ¶
Leases registers the behavior specs for an adapter that implements lease.Provider. Registered separately from Conformance because the provider is optional; an adapter without one does not call this.
newShared returns two adapter handles that share one lease space, plus a cleanup that closes what backs them. For a shared-database adapter that is two opens of the same database — the two-node deployment the leases exist for; for a single-process adapter it is the same store handed back twice, which is the whole sharing that adapter's model permits.
func Replica ¶
Replica registers the behavior specs for an adapter that implements storage.ReplicaProvider. Registered separately from Conformance because the capability is optional; an adapter without one does not call this. newAdapter is called per spec and must return a fresh, empty store with a replica configured — pointing the replica at the primary itself is enough, since the specs pin routing and the read contract, not lag. It is closed afterwards.
Types ¶
This section is empty.