storage

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// An error indicating a given key does not exist
	ErrKeyNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type Storage

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

func NewStorage

func NewStorage(path string) (*Storage, error)

func (*Storage) Close

func (b *Storage) Close() error

func (*Storage) DeleteRange

func (b *Storage) DeleteRange(min, max uint64) error

func (*Storage) FirstIndex

func (b *Storage) FirstIndex() (uint64, error)

func (*Storage) Get

func (b *Storage) Get(k []byte) ([]byte, error)

func (*Storage) GetLog

func (b *Storage) GetLog(idx uint64, log *raft.Log) error

func (*Storage) GetUint64

func (b *Storage) GetUint64(key []byte) (uint64, error)

func (*Storage) LastIndex

func (b *Storage) LastIndex() (uint64, error)

func (*Storage) Set

func (b *Storage) Set(k, v []byte) error

func (*Storage) SetUint64

func (b *Storage) SetUint64(key []byte, val uint64) error

func (*Storage) StoreLog

func (b *Storage) StoreLog(log *raft.Log) error

func (*Storage) StoreLogs

func (b *Storage) StoreLogs(logs []*raft.Log) error

func (*Storage) Sync

func (b *Storage) Sync() error

Jump to

Keyboard shortcuts

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