aof

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: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogDir = "wal"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger        *zap.Logger
	HasnFn        memory.HashFn
	DataDir       string
	FlushInterval time.Duration
}

type DiskKV

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

func New

func New(cfg Config) (*DiskKV, error)

func (*DiskKV) Acquire

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

func (*DiskKV) Delete

func (d *DiskKV) Delete(ctx context.Context, key []byte) error

func (*DiskKV) Export

func (d *DiskKV) Export(keys [][]byte) []*protocol.KVTransfer

func (*DiskKV) Get

func (d *DiskKV) Get(ctx context.Context, key []byte) (value []byte, err error)

func (*DiskKV) Import

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

func (*DiskKV) ListKeys

func (d *DiskKV) ListKeys(ctx context.Context, prefix []byte) ([]*protocol.KeyComposite, error)

func (*DiskKV) PrefixAppend

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

func (*DiskKV) PrefixContains

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

func (*DiskKV) PrefixList

func (d *DiskKV) PrefixList(ctx context.Context, prefix []byte) (children [][]byte, err error)

func (*DiskKV) PrefixRemove

func (d *DiskKV) PrefixRemove(ctx context.Context, prefix []byte, child []byte) error

func (*DiskKV) Put

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

func (*DiskKV) RangeKeys

func (d *DiskKV) RangeKeys(low, high uint64) [][]byte

func (*DiskKV) Release

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

func (*DiskKV) RemoveKeys

func (d *DiskKV) RemoveKeys(keys [][]byte)

func (*DiskKV) Renew

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

func (*DiskKV) Start

func (d *DiskKV) Start()

func (*DiskKV) Stop

func (d *DiskKV) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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