Documentation
¶
Overview ¶
Package cosmosbatch provides a state.Store implementation that wraps the in-memory store and mirrors Azure Cosmos DB's transactional-batch semantics: if any delete operation in a Multi targets a key that does not exist, the whole batch is rejected with a generic "transaction failed" error and none of the operations are applied. The real Cosmos DB component (components-contrib/state/azure/cosmosdb) cannot tolerate a 404 on an individual delete inside a batch even though the component is structured to permit etag-less delete-on-missing outside transactions; tests use this wrapper to reproduce that asymmetry without booting Cosmos.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
Store wraps an in-memory state store and rejects any Multi whose delete operations reference a key not currently present in the store.
func New ¶
New returns a Store backed by the integration framework's in-memory state store with Cosmos-style batch semantics applied to Multi.
func (*Store) Multi ¶
Multi implements state.TransactionalStore. Before delegating, every delete in req is checked against the underlying store; if any references a key that does not currently exist, the whole batch is rejected with the "transaction failed" error that the real Cosmos component returns when an operation fails with FailedDependency status code.
func (*Store) MultiMaxSize ¶
MultiMaxSize advertises no per-transaction key limit; the cap is enforced by the real Cosmos component and is not what this wrapper is exercising.
func (*Store) RejectedCount ¶
RejectedCount returns the number of Multi requests this Store has refused because they contained a delete for a missing key.