idempotency

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package idempotency provides an in-memory deduplication store for BubbleFish Nexus write requests.

The store is always empty on process start and rebuilt exclusively from WAL replay. It is never persisted to disk. This invariant ensures that duplicate detection is consistent with the durable WAL state after a crash.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is a thread-safe in-memory deduplication map. All state is in struct fields; there are no package-level variables.

func New

func New() *Store

New returns an empty Store ready for use.

func (*Store) PayloadID

func (s *Store) PayloadID(id string) bool

PayloadID returns true if id has been registered as a payload_id. Used by consistency assertions (Phase R-10).

func (*Store) Register

func (s *Store) Register(key, payloadID string)

Register records an idempotency_key → payload_id mapping. If the key is already registered, the existing mapping is overwritten (idempotent for WAL replay where the same PENDING entry may appear in multiple segments).

func (*Store) Seen

func (s *Store) Seen(key string) (string, bool)

Seen returns the payload_id previously registered for key, and true. Returns ("", false) if the key has not been seen.

Jump to

Keyboard shortcuts

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