Documentation
¶
Index ¶
- Variables
- type DiskBTree
- func (t *DiskBTree) Close() error
- func (t *DiskBTree) Delete(key []byte) error
- func (t *DiskBTree) Find(key []byte) ([]byte, error)
- func (t *DiskBTree) Insert(key, value []byte) error
- func (t *DiskBTree) Print(withPointers bool) error
- func (t *DiskBTree) PrintLeaves() error
- func (t *DiskBTree) PrintLeavesBackwards() error
- func (t *DiskBTree) Update(key, newValue []byte) error
- type DiskBTreeFile
- type DiskBTreeNode
- type MasterPage
Constants ¶
This section is empty.
Variables ¶
View Source
var INVALID_DATA_ERROR = errors.New("Invalid data")
View Source
var INVALID_KEY_ERROR = errors.New("Invalid key")
View Source
var INVALID_KEY_INDEX_ERROR = errors.New("Invalid key index")
View Source
var INVALID_KEY_SIZE_ERROR = errors.New("Invalid key size. All keys must have the same length")
View Source
var INVALID_POINTER_INDEX_ERROR = errors.New("Invalid pointer index")
View Source
var KEY_ALREADY_EXISTS_ERROR = errors.New("Key already exists")
View Source
var KEY_NOT_FOUND_ERROR = errors.New("Key not found")
View Source
var KEY_SIZE_TOO_LARGE = errors.New("The key size is too large.")
View Source
var TYPE_CONVERSION_ERROR = errors.New("Error while converting interface to type")
Functions ¶
This section is empty.
Types ¶
type DiskBTree ¶
type DiskBTree struct {
// contains filtered or unexported fields
}
func (*DiskBTree) PrintLeaves ¶
func (*DiskBTree) PrintLeavesBackwards ¶
type DiskBTreeFile ¶
type DiskBTreeNode ¶
type DiskBTreeNode struct { Ptr uint64 IsLeaf bool Numkeys uint16 Parent uint64 Next uint64 Prev uint64 Keysize uint16 Keys [][]byte Pointers []interface{} }
func BytesToNode ¶
func BytesToNode(b []byte, ptr uint64) *DiskBTreeNode
func (*DiskBTreeNode) ToBytes ¶
func (n *DiskBTreeNode) ToBytes() []byte
1b isLeaf, 2b numkeys, 8b parent, 8b next, 8b prev, 2b keysize, (keysize * numkeys) keys, isLeaf ? ((2b dataLength + data) * numkeys) else ((numkeys + 1) * 8)
type MasterPage ¶
type MasterPage struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.