memory

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package memory provides low-level persistence implementations that store data in memory.

They are intended to be used as reference implementations and for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJournal

func NewJournal() journal.Journal

NewJournal returns a new standalone journal.

Types

type JournalStore

type JournalStore struct {
	BeforeOpenHook   func(name string) error
	BeforeAppendHook func(name string, rec []byte) error
	AfterAppendHook  func(name string, rec []byte) error
	// contains filtered or unexported fields
}

JournalStore is an implementation of journal.Store that stores journals in memory.

func (*JournalStore) Open

func (s *JournalStore) Open(ctx context.Context, name string) (journal.Journal, error)

Open returns the journal with the given name.

type KeyValueStore

type KeyValueStore struct {
	BeforeSetHook func(ks string, k, v []byte) error
	AfterSetHook  func(ks string, k, v []byte) error
	// contains filtered or unexported fields
}

KeyValueStore is an implementation of kv.Store that stores keyspaces in memory.

func (*KeyValueStore) Open

func (s *KeyValueStore) Open(ctx context.Context, name string) (kv.Keyspace, error)

Open returns the keyspace with the given name.

Jump to

Keyboard shortcuts

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