memorykv

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package memorykv provides an in-memory implementation of kv.BinaryStore.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryStore added in v0.8.0

type BinaryStore struct {
	// BeforeSet, if non-nil, is called before a value is set.
	BeforeSet func(ks string, k, v []byte) error

	// AfterSet, if non-nil, is called after a value is set.
	AfterSet func(ks string, k, v []byte) error
	// contains filtered or unexported fields
}

BinaryStore is an implementation of [journal.BinaryStore] that stores records in memory.

func (*BinaryStore) Open added in v0.8.0

func (s *BinaryStore) Open(ctx context.Context, name string) (kv.BinaryKeyspace, error)

Open returns the keyspace with the given name.

type Store

type Store[K comparable, V any] struct {
	// BeforeSet, if non-nil, is called before a value is set.
	BeforeSet func(ks string, k K, v V) error

	// AfterSet, if non-nil, is called after a value is set.
	AfterSet func(ks string, k K, v V) error
	// contains filtered or unexported fields
}

Store is an in-memory implementation of kv.Store.

func (*Store[K, V]) Open

func (s *Store[K, V]) Open(ctx context.Context, name string) (kv.Keyspace[K, V], 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