btreedb5

package
v0.0.0-...-157ca18 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IndexNode = 'I'
	LeafNode  = 'L'
	FreeNode  = 'F'
)

Variables

View Source
var (
	Magic = []byte{'B', 'T', 'r', 'e', 'e', 'D', 'B', '5'}
)

Functions

This section is empty.

Types

type BTree

type BTree struct {
	FreeIndex  uint  // HeadFreeIndex
	Size       int64 // DeviceSize
	RootBlock  uint
	RootIsLeaf bool
}

type BTreeDB5

type BTreeDB5 struct {
	Identifier string
	BlockSize  int
	KeySize    int
	UseAltRoot bool
	Tree       BTree
	// contains filtered or unexported fields
}

func Load

func Load(file string) (h *BTreeDB5, e error)

func New

func New(file string, ident string, blksz, keysz int) (h *BTreeDB5, e error)

func (*BTreeDB5) Ascend

func (h *BTreeDB5) Ascend(iter Iterator) (e error)

func (*BTreeDB5) AscendRange

func (h *BTreeDB5) AscendRange(start, stop Key, iter Iterator) (e error)

func (*BTreeDB5) Close

func (h *BTreeDB5) Close() error

func (*BTreeDB5) Commit

func (h *BTreeDB5) Commit() (e error)

func (*BTreeDB5) Descend

func (h *BTreeDB5) Descend(iter Iterator) (e error)

func (*BTreeDB5) DescendRange

func (h *BTreeDB5) DescendRange(start, stop Key, iter Iterator) (e error)

func (*BTreeDB5) First

func (h *BTreeDB5) First() (k Key, r ByteArray, e error)

func (*BTreeDB5) Get

func (h *BTreeDB5) Get(key Key) (r ByteArray, e error)

func (*BTreeDB5) Has

func (h *BTreeDB5) Has(key Key) (r bool, e error)

func (*BTreeDB5) Insert

func (h *BTreeDB5) Insert(key Key, data ByteArray) (e error)

func (*BTreeDB5) Last

func (h *BTreeDB5) Last() (k Key, r ByteArray, e error)

func (*BTreeDB5) Remove

func (h *BTreeDB5) Remove(key Key) (e error)

func (*BTreeDB5) Rollback

func (h *BTreeDB5) Rollback() (e error)

type ByteArray

type ByteArray = data_types.ByteArray

type Iterator

type Iterator func(Key, []byte)

type Key

type Key []byte

Jump to

Keyboard shortcuts

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