memory

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package memory provides a thread-safe in-memory implementation of storage.Repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

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

Repository is a thread-safe in-memory implementation of storage.Repository. Suitable for testing, demos, and single-process use cases.

func NewRepository

func NewRepository() *Repository

NewRepository creates a new empty in-memory Repository.

func (*Repository) Batch

func (r *Repository) Batch(vaultID string, fn func(tx storage.BatchTx) error) error

Batch executes fn within a batch transaction. On error, all writes are rolled back.

func (*Repository) Delete

func (r *Repository) Delete(vaultID, recordType, recordID string) error

func (*Repository) DeleteVault

func (r *Repository) DeleteVault(vaultID string) error

func (*Repository) Get

func (r *Repository) Get(vaultID, recordType, recordID string) (*storage.Envelope, error)

func (*Repository) List

func (r *Repository) List(vaultID, recordType string) ([]string, error)

func (*Repository) ListVaults

func (r *Repository) ListVaults() ([]string, error)

func (*Repository) Put

func (r *Repository) Put(vaultID, recordType, recordID string, envelope *storage.Envelope) error

func (*Repository) PutCAS

func (r *Repository) PutCAS(vaultID, recordType, recordID string, expectedVersion uint64, envelope *storage.Envelope) error

Jump to

Keyboard shortcuts

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