From c3903d38a10fda3c9a366d62705e06ddc558eb2d Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Mon, 5 May 2014 07:56:54 -0600 Subject: Consolidate code for clarity. This commit consolidates some of the smaller files into some of the larger files. The smaller files cluttered the file tree and made it harder to see the logical groupings of structs. --- bucket.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'bucket.go') 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 -- cgit v1.2.3