memory

package
v0.5.0 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) ClaimSlot added in v0.3.0

func (s *Store) ClaimSlot(_ context.Context, req store.ClaimRequest) (store.ClaimResult, error)

ClaimSlot 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) DeleteSlot added in v0.3.0

func (s *Store) DeleteSlot(_ context.Context, owner, subject string) ([]store.Key, error)

DeleteSlot implements store.Store.

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) GetSlot added in v0.3.0

func (s *Store) GetSlot(_ context.Context, owner string) (store.Slot, bool, error)

GetSlot 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.

func (*Store) SetSlotLabel added in v0.4.0

func (s *Store) SetSlotLabel(_ context.Context, owner, subject, label string) (store.Slot, error)

SetSlotLabel implements store.Store.

Jump to

Keyboard shortcuts

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