Documentation
¶
Overview ¶
Package storetest provides the shared unit-test suite that every binarystore implementation runs against a fake backend. Keeping the suite in one place means the providers are held to the same behaviour: identical sentinel errors, identical create-only and overwrite semantics, identical streaming and prefix handling.
The conformance suite in tests/conformance/binarystore asserts the same behaviour against real backends; this suite is its offline counterpart.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EmptyReader ¶
type EmptyReader struct{}
EmptyReader is an io.Reader that immediately reports io.EOF.
It is deliberately not one of the concrete types (*bytes.Buffer, *bytes.Reader, *strings.Reader, *os.File) that provider SDKs special-case when detecting zero-length bodies. Readers handed to a component by the Dapr runtime have this shape, so using it here catches providers that only support empty payloads for the special-cased types.
type Harness ¶
type Harness struct {
// Store is an initialised binary store configured with Prefix.
Store binarystore.BinaryStore
// Prefix is the object prefix the store was configured with.
Prefix string
// Names returns the object names currently held by the backend, as the
// backend sees them (so including Prefix). It may be nil if the backend
// cannot enumerate its contents, in which case prefix assertions are
// skipped.
Names func() []string
}
Harness is a single provider instance wired to a fake backend.