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

memory

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Overview

Package memory is the stack's in-memory storage profile, for tests and experiments. Nothing survives the process.

A Backend may hand out several Storage handles onto the same stores, which is how a test restarts a stack over the same state, or runs a Factory with RemoteHosts and a ServeHost Host in one binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open() stack.Storage

Open is New().Storage() for a single use: its Close is the Backend's.

Types

type Backend

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

Backend is one set of in-memory stores: a control composite and one journal composite per tenant, created on first use.

func New

func New() *Backend

New returns an empty Backend. Its workspace directory is a fresh path under os.TempDir, created on first use and removed by Close.

func (*Backend) Close

func (b *Backend) Close() error

Close removes the workspace directory. The stores themselves are garbage.

func (*Backend) Storage

func (b *Backend) Storage() stack.Storage

Storage returns a handle onto b. Its Close does nothing, so the state outlives a stopped stack; close the Backend when done.

Jump to

Keyboard shortcuts

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