diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-01-17 15:23:39 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-01-17 15:23:39 -0700 |
commit | 153372abd4adbcdb0a8be7eecddcfe5b5c885d9f (patch) | |
tree | c4bb425337b467a9f6d06206f03c0101403c8a43 /leaf_node.go | |
parent | Add system buckets. (diff) | |
download | dedo-153372abd4adbcdb0a8be7eecddcfe5b5c885d9f.tar.gz dedo-153372abd4adbcdb0a8be7eecddcfe5b5c885d9f.tar.xz |
Refactoring to RWCursor, RWTxn, and branch/leaf nodes and pages.
Diffstat (limited to 'leaf_node.go')
-rw-r--r-- | leaf_node.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/leaf_node.go b/leaf_node.go new file mode 100644 index 0000000..80b5cf7 --- /dev/null +++ b/leaf_node.go @@ -0,0 +1,18 @@ +package bolt + +import ( + "unsafe" +) + +// leafNode represents a node on a leaf page. +type leafNode struct { + flags uint16 + keySize uint16 + dataSize uint32 + data uintptr // Pointer to the beginning of the data. +} + +// key returns a byte slice that of the key data. +func (n *leafNode) key() []byte { + return (*[MaxKeySize]byte)(unsafe.Pointer(&n.data))[:n.keySize] +} |