memory

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Overview

Package memory implements store.Store in memory, for tests and local runs. A restart deletes all databases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store keeps the databases in memory.

func New

func New() *Store

New returns an empty store.

func (*Store) Changes

func (s *Store) Changes(_ context.Context, key store.Key, fromVersion uint64) (store.ChangeSet, error)

Changes implements store.Store.

func (*Store) Commit

func (s *Store) Commit(_ context.Context, req store.CommitRequest) (uint64, error)

Commit implements store.Store.

func (*Store) Delete

func (*Store) DeleteUnused

func (s *Store) DeleteUnused(_ context.Context, cutoff time.Time, limit int) ([]store.Key, error)

DeleteUnused implements store.Store.

func (*Store) Fetch

func (s *Store) Fetch(_ context.Context, key store.Key, version, first, count uint64) ([][]byte, error)

Fetch implements store.Store.

func (*Store) Open

Open implements store.Store.

func (*Store) Ping

func (s *Store) Ping(context.Context) error

Ping implements store.Store. It always succeeds.

func (*Store) Release

func (s *Store) Release(_ context.Context, key store.Key, epoch uint64) error

Release implements store.Store.

func (*Store) Renew

func (s *Store) Renew(_ context.Context, key store.Key, epoch uint64, now time.Time, ttl time.Duration) error

Renew implements store.Store.

Jump to

Keyboard shortcuts

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