memory

package
v0.0.0-...-d687121 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashFn

type HashFn func([]byte) uint64

type MemoryKV

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

func WithHashFn

func WithHashFn(fn HashFn) *MemoryKV

func (*MemoryKV) Acquire

func (m *MemoryKV) Acquire(ctx context.Context, lease []byte, ttl time.Duration) (token uint64, err error)

func (*MemoryKV) Delete

func (m *MemoryKV) Delete(ctx context.Context, key []byte) error

func (*MemoryKV) Export

func (m *MemoryKV) Export(keys [][]byte) []*protocol.KVTransfer

func (*MemoryKV) Get

func (m *MemoryKV) Get(ctx context.Context, key []byte) ([]byte, error)

func (*MemoryKV) Import

func (m *MemoryKV) Import(ctx context.Context, keys [][]byte, values []*protocol.KVTransfer) error

func (*MemoryKV) ListKeys

func (m *MemoryKV) ListKeys(_ context.Context, prefix []byte) ([]*protocol.KeyComposite, error)

func (*MemoryKV) PrefixAppend

func (m *MemoryKV) PrefixAppend(ctx context.Context, prefix []byte, child []byte) error

func (*MemoryKV) PrefixContains

func (m *MemoryKV) PrefixContains(ctx context.Context, prefix []byte, child []byte) (bool, error)

func (*MemoryKV) PrefixList

func (m *MemoryKV) PrefixList(ctx context.Context, prefix []byte) ([][]byte, error)

func (*MemoryKV) PrefixRemove

func (m *MemoryKV) PrefixRemove(ctx context.Context, prefix []byte, needle []byte) error

func (*MemoryKV) Put

func (m *MemoryKV) Put(ctx context.Context, key, value []byte) error

func (*MemoryKV) RangeKeys

func (m *MemoryKV) RangeKeys(low, high uint64) [][]byte

func (*MemoryKV) Release

func (m *MemoryKV) Release(ctx context.Context, lease []byte, token uint64) error

func (*MemoryKV) RemoveKeys

func (m *MemoryKV) RemoveKeys(keys [][]byte)

func (*MemoryKV) Renew

func (m *MemoryKV) Renew(ctx context.Context, lease []byte, ttl time.Duration, prevToken uint64) (newToken uint64, err error)

Jump to

Keyboard shortcuts

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