db

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Dir string
}

type DbStore

type DbStore interface {
	// Stable store functions
	Get(key []byte) ([]byte, error)

	Set(key, val []byte) error

	SetUint64(key []byte, val uint64) error

	GetUint64(key []byte) (uint64, error)

	// Log store functions
	FirstIndex() (uint64, error)

	LastIndex() (uint64, error)

	GetLog(index uint64, log *raft.Log) error

	StoreLog(log *raft.Log) error

	StoreLogs(logs []*raft.Log) error

	DeleteRange(min, max uint64) error

	Close() error
}

func New

func New(dbType string, config *Config) (DbStore, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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