byodb06

package
v0.0.0-...-9315a8a Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BNODE_NODE = 1 // internal nodes without values
	BNODE_LEAF = 2 // leaf nodes with values
)
View Source
const BTREE_MAX_KEY_SIZE = 1000
View Source
const BTREE_MAX_VAL_SIZE = 3000
View Source
const BTREE_PAGE_SIZE = 4096
View Source
const DB_SIG = "BuildYourOwnDB06"
View Source
const HEADER = 4

Variables

This section is empty.

Functions

This section is empty.

Types

type BNode

type BNode []byte // can be dumped to the disk

type BTree

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

func (*BTree) Delete

func (tree *BTree) Delete(key []byte) bool

func (*BTree) Get

func (tree *BTree) Get(key []byte) ([]byte, bool)

func (*BTree) Insert

func (tree *BTree) Insert(key []byte, val []byte)

the interface

type KV

type KV struct {
	Path  string
	Fsync func(int) error // overridable; for testing
	// contains filtered or unexported fields
}

func (*KV) Close

func (db *KV) Close()

cleanups

func (*KV) Del

func (db *KV) Del(key []byte) (bool, error)

func (*KV) Get

func (db *KV) Get(key []byte) ([]byte, bool)

KV interfaces

func (*KV) Open

func (db *KV) Open() error

open or create a DB file

func (*KV) Set

func (db *KV) Set(key []byte, val []byte) error

Jump to

Keyboard shortcuts

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