Help us shape the future of Go! Take the 2026 Go Developer Survey

memory

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

Types

type Memory

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

func (*Memory) Compact

func (m *Memory) Compact(ctx context.Context, revision int64) (int64, error)

Compact discards events below the given revision. The log slice is trimmed to entries with revision > the compact target — events at or below the boundary are no longer accessible to watchers. Per-key history in m.keys is trimmed to its floor (the latest entry with revision <= the target) so that reads at the compact boundary still resolve to the correct value; if that floor is a tombstone the entire key history is removed. Entries with revision > the compact target are always retained.

func (*Memory) Count

func (m *Memory) Count(ctx context.Context, key, end string, revision int64) (int64, int64, error)

func (*Memory) Create

func (m *Memory) Create(ctx context.Context, key string, value []byte, lease int64) (int64, error)

func (*Memory) CurrentRevision

func (m *Memory) CurrentRevision(ctx context.Context) (int64, error)

func (*Memory) DbSize

func (m *Memory) DbSize(ctx context.Context) (int64, error)

func (*Memory) Delete

func (m *Memory) Delete(ctx context.Context, key string, revision int64) (int64, *server.KeyValue, bool, error)

func (*Memory) Get

func (m *Memory) Get(ctx context.Context, key string, revision int64, keysOnly bool) (int64, *server.KeyValue, error)

Get returns the current revision and the KeyValue for the given key.

func (*Memory) List

func (m *Memory) List(ctx context.Context, key, end string, limit, revision int64, keysOnly bool) (int64, []*server.KeyValue, error)

func (*Memory) Start

func (m *Memory) Start(ctx context.Context) error

func (*Memory) Update

func (m *Memory) Update(ctx context.Context, key string, value []byte, revision, lease int64) (int64, *server.KeyValue, bool, error)

func (*Memory) WaitForSyncTo

func (m *Memory) WaitForSyncTo(revision int64)

func (*Memory) Watch

func (m *Memory) Watch(ctx context.Context, key, end string, startRevision int64) server.WatchResult

Jump to

Keyboard shortcuts

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