Help us shape the future of Go! Take the 2026 Go Developer Survey

memory

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package memory provides reference in-process implementations of every storage.Kind. They are intended for development, testing, and single-process flows where durability is not required.

Every Backend here is registered by the Flow storage extension's Bundle() so a freshly-installed Flow has working storage without any external dependency. Production deployments register additional Backends (Redis, S3, Postgres, ...) via @require.

Memory backends are safe for concurrent use. They do not enforce size bounds; unbounded growth in production will exhaust memory. Use them in production only for short-lived state (request-scoped caches, test fixtures).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blob

type Blob struct{}

Blob is the in-memory BlobStore backend.

func NewBlob

func NewBlob() *Blob

func (Blob) Kind

func (Blob) Kind() storage.Kind

func (Blob) Name

func (Blob) Name() string

func (Blob) Open

func (Blob) Open(_ map[string]string) (storage.Instance, error)

type FencedLock

type FencedLock struct{}

FencedLock is the in-memory FencedMutex backend. The fence counter is process-local; a real backend (Redis, etcd) must source it from the underlying store's monotonic version.

func NewFencedLock

func NewFencedLock() *FencedLock

func (FencedLock) Kind

func (FencedLock) Kind() storage.Kind

func (FencedLock) Name

func (FencedLock) Name() string

func (FencedLock) Open

func (FencedLock) Open(_ map[string]string) (storage.Instance, error)

type Idem

type Idem struct{}

Idem is the in-memory IdempotencyStore backend. It also implements action.IdempotencyCoordinator so callers that probe for the coordinator capability get the full state machine.

func NewIdem

func NewIdem() *Idem

func (Idem) Kind

func (Idem) Kind() storage.Kind

func (Idem) Name

func (Idem) Name() string

func (Idem) Open

func (Idem) Open(opts map[string]string) (storage.Instance, error)

type Journal

type Journal struct{}

Journal is the in-memory Journal backend. Used by action.Durable for step-level memoization.

func NewJournal

func NewJournal() *Journal

func (Journal) Kind

func (Journal) Kind() storage.Kind

func (Journal) Name

func (Journal) Name() string

func (Journal) Open

func (Journal) Open(_ map[string]string) (storage.Instance, error)

type KV

type KV struct{}

KV is the in-memory CacheLayer backend.

func NewKV

func NewKV() *KV

NewKV returns a KV backend.

func (KV) Kind

func (KV) Kind() storage.Kind

func (KV) Name

func (KV) Name() string

func (KV) Open

func (KV) Open(opts map[string]string) (storage.Instance, error)

type Lock

type Lock struct{}

Lock is the in-memory Mutex backend.

func NewLock

func NewLock() *Lock

func (Lock) Kind

func (Lock) Kind() storage.Kind

func (Lock) Name

func (Lock) Name() string

func (Lock) Open

func (Lock) Open(_ map[string]string) (storage.Instance, error)

type RateLimit

type RateLimit struct{}

RateLimit is the in-memory RateLimiter backend.

func NewRateLimit

func NewRateLimit() *RateLimit

func (RateLimit) Kind

func (RateLimit) Kind() storage.Kind

func (RateLimit) Name

func (RateLimit) Name() string

func (RateLimit) Open

func (RateLimit) Open(opts map[string]string) (storage.Instance, error)

type Tx

type Tx struct{}

Tx is the in-memory TxRunner backend. It does not provide real transactional semantics; it simply invokes fn. Useful only for tests where transactional behavior is mocked.

func NewTx

func NewTx() *Tx

func (Tx) Kind

func (Tx) Kind() storage.Kind

func (Tx) Name

func (Tx) Name() string

func (Tx) Open

func (Tx) Open(_ map[string]string) (storage.Instance, error)

Jump to

Keyboard shortcuts

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