aboutsummaryrefslogtreecommitdiff
path: root/bucket.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-05-05 07:58:53 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-05-05 07:58:53 -0600
commit6133ecb878b8ae6a7c8c9335c4e6ad2c64090d57 (patch)
tree504e0dcfc35536f7f9023aca59895c653bf68bee /bucket.go
parentMerge pull request #152 from benbjohnson/remove-bolt-set (diff)
parentConsolidate code for clarity. (diff)
downloaddedo-6133ecb878b8ae6a7c8c9335c4e6ad2c64090d57.tar.gz
dedo-6133ecb878b8ae6a7c8c9335c4e6ad2c64090d57.tar.xz
Merge pull request #153 from benbjohnson/consolidate
Consolidate code for clarity.
Diffstat (limited to 'bucket.go')
-rw-r--r--bucket.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/bucket.go b/bucket.go
index 0b9c17d..5dd79dd 100644
--- a/bucket.go
+++ b/bucket.go
@@ -7,6 +7,14 @@ import (
"unsafe"
)
+const (
+ // MaxKeySize is the maximum length of a key, in bytes.
+ MaxKeySize = 32768
+
+ // MaxValueSize is the maximum length of a value, in bytes.
+ MaxValueSize = 4294967295
+)
+
var (
// ErrBucketNotFound is returned when trying to access a bucket that has
// not been created yet.
@@ -37,6 +45,13 @@ var (
ErrSequenceOverflow = errors.New("sequence overflow")
)
+const (
+ maxUint = ^uint(0)
+ minUint = 0
+ maxInt = int(^uint(0) >> 1)
+ minInt = -maxInt - 1
+)
+
// Bucket represents a collection of key/value pairs inside the database.
type Bucket struct {
*bucket