cosmosbatch

package
v1.17.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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

type Store struct {
	*inmemory.Wrapped
	// contains filtered or unexported fields
}

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

func New(t *testing.T) *Store

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

func (s *Store) MultiMaxSize() int

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

func (s *Store) RejectedCount() int

RejectedCount returns the number of Multi requests this Store has refused because they contained a delete for a missing key.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL