adapters

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryRepository

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

InMemoryRepository is a database adapter implementing ports.Repository, suitable for local development and tests. It also exposes Closed(), which is not part of ports.Repository — it lets tests verify (via modtest.AssertResourceOwnership) that module.go's Stop releases it. See docs/planning/scaffolding-and-test-harness-guide.md.

func NewInMemoryRepository

func NewInMemoryRepository() *InMemoryRepository

NewInMemoryRepository creates a thread-safe local storage adapter.

func (*InMemoryRepository) Close

func (r *InMemoryRepository) Close() error

Close marks the repository closed, releasing it. Safe to call more than once.

func (*InMemoryRepository) Closed

func (r *InMemoryRepository) Closed() bool

Closed reports whether Close has been called. It satisfies modtest.ResourceOwner structurally, without this package importing modtest.

func (*InMemoryRepository) FindAll

func (*InMemoryRepository) Save

Jump to

Keyboard shortcuts

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