fsmdb

package
v0.0.0-...-569481b Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SnapDir        = "snaps"
	MetaFileSuffix = ".meta.json"
	SnapFileSuffix = ".badger.bak"
	TimeFileSuffix = ".badger.time"
)
View Source
const StateDir = "states"

Variables

This section is empty.

Functions

func SnapshotID

func SnapshotID(index uint64) string

Types

type BackupDumper

type BackupDumper interface {
	Backup() error
}

type DB

type DB struct {
	*badger.DB
	// contains filtered or unexported fields
}

func Open

func Open(dataDir string) (*DB, error)

func (*DB) Create

func (d *DB) Create(
	version raft.SnapshotVersion,
	index, term uint64,
	configuration raft.Configuration,
	configurationIndex uint64,
	_ raft.Transport,
) (raft.SnapshotSink, error)

func (*DB) List

func (d *DB) List() (ret []*raft.SnapshotMeta, err error)

func (*DB) Open

func (d *DB) Open(id string) (*raft.SnapshotMeta, io.ReadCloser, error)

func (*DB) Update

func (d *DB) Update(f func(tx *Tx) error) error

func (*DB) View

func (d *DB) View(f func(tx *Tx) error) error

type Tx

type Tx struct {
	*badger.Txn
	// contains filtered or unexported fields
}

func (*Tx) Inc

func (tx *Tx) Inc(key []byte) (old uint64, err error)

func (*Tx) Iter

func (tx *Tx) Iter(prefix []byte, withValues bool) *badger.Iterator

func (*Tx) Uint64

func (tx *Tx) Uint64(key, dst []byte) (uint64, error)

Jump to

Keyboard shortcuts

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