aboutsummaryrefslogtreecommitdiff
path: root/cmd/bolt
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-06-21 14:44:22 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-06-21 14:44:28 -0600
commit00ee0da5289dd5aaf9263ee39c8082ff3a9557c7 (patch)
treeeb405a03d008ee600d3d59ac2fe657caf397eabe /cmd/bolt
parentMerge pull request #206 from Shopify/pending_page_stats (diff)
downloaddedo-00ee0da5289dd5aaf9263ee39c8082ff3a9557c7.tar.gz
dedo-00ee0da5289dd5aaf9263ee39c8082ff3a9557c7.tar.xz
Add Open() options, flock timeout.
This commit changes Open() to provide an additional Options argument. The options argument currently only has a Timeout which will cause the Open() to return ErrTimeout if a file lock cannot be obtained in time. Fixes #207.
Diffstat (limited to 'cmd/bolt')
-rw-r--r--cmd/bolt/bench.go2
-rw-r--r--cmd/bolt/buckets.go2
-rw-r--r--cmd/bolt/check.go2
-rw-r--r--cmd/bolt/export.go2
-rw-r--r--cmd/bolt/get.go2
-rw-r--r--cmd/bolt/import.go2
-rw-r--r--cmd/bolt/import_test.go2
-rw-r--r--cmd/bolt/info.go2
-rw-r--r--cmd/bolt/keys.go2
-rw-r--r--cmd/bolt/main_test.go2
-rw-r--r--cmd/bolt/pages.go2
-rw-r--r--cmd/bolt/stats.go2
12 files changed, 12 insertions, 12 deletions
diff --git a/cmd/bolt/bench.go b/cmd/bolt/bench.go
index 5d0dbec..7eb503d 100644
--- a/cmd/bolt/bench.go
+++ b/cmd/bolt/bench.go
@@ -41,7 +41,7 @@ func Bench(options *BenchOptions) {
}
// Create database.
- db, err := bolt.Open(path, 0600)
+ db, err := bolt.Open(path, 0600, nil)
if err != nil {
fatal(err)
return
diff --git a/cmd/bolt/buckets.go b/cmd/bolt/buckets.go
index 48395d8..68e7dde 100644
--- a/cmd/bolt/buckets.go
+++ b/cmd/bolt/buckets.go
@@ -13,7 +13,7 @@ func Buckets(path string) {
return
}
- db, err := bolt.Open(path, 0600)
+ db, err := bolt.Open(path, 0600, nil)
if err != nil {
fatal(err)
return
diff --git a/cmd/bolt/check.go b/cmd/bolt/check.go
index 7555ec8..125f2b8 100644
--- a/cmd/bolt/check.go
+++ b/cmd/bolt/check.go
@@ -13,7 +13,7 @@ func Check(path string) {
return
}
- db, err := bolt.Open(path, 0600)
+ db, err := bolt.Open(path, 0600, nil)
if err != nil {
fatal(err)
return
diff --git a/cmd/bolt/export.go b/cmd/bolt/export.go
index 2dcbc1f..2689f32 100644
--- a/cmd/bolt/export.go
+++ b/cmd/bolt/export.go
@@ -16,7 +16,7 @@ func Export(path string) {
}
// Open the database.
- db, err := bolt.Open(path, 0600)
+ db, err := bolt.Open(path, 0600, nil)
if err != nil {
fatal(err)
return
diff --git a/cmd/bolt/get.go b/cmd/bolt/get.go
index 6ea7f04..90e0c1d 100644
--- a/cmd/bolt/get.go
+++ b/cmd/bolt/get.go
@@ -13,7 +13,7 @@ func Get(path, name, key string) {
return
}
- db, err := bolt.Open(path, 0600)
+ db, err := bolt.Open(path, 0600, nil)
if err != nil {
fatal(err)
return
diff --git a/cmd/bolt/import.go b/cmd/bolt/import.go
index 0988f32..258a7da 100644
--- a/cmd/bolt/import.go
+++ b/cmd/bolt/import.go
@@ -29,7 +29,7 @@ func Import(path string, input string) {
func importBuckets(path string, root []*rawMessage) {
// Open the database.
- db, err := bolt.Open(path, 0600)
+ db, err := bolt.Open(path, 0600, nil)
if err != nil {
fatal(err)
return
diff --git a/cmd/bolt/import_test.go b/cmd/bolt/import_test.go
index 263f561..3d4f275 100644
--- a/cmd/bolt/import_test.go
+++ b/cmd/bolt/import_test.go
@@ -23,7 +23,7 @@ func TestImport(t *testing.T) {
assert.Equal(t, ``, output)
// Open database and verify contents.
- db, err := bolt.Open(path, 0600)
+ db, err := bolt.Open(path, 0600, nil)
assert.NoError(t, err)
db.View(func(tx *bolt.Tx) error {
assert.NotNil(t, tx.Bucket([]byte("empty")))
diff --git a/cmd/bolt/info.go b/cmd/bolt/info.go
index 1e9e0d8..5606e68 100644
--- a/cmd/bolt/info.go
+++ b/cmd/bolt/info.go
@@ -13,7 +13,7 @@ func Info(path string) {
return
}
- db, err := bolt.Open(path, 0600)
+ db, err := bolt.Open(path, 0600, nil)
if err != nil {
fatal(err)
return
diff --git a/cmd/bolt/keys.go b/cmd/bolt/keys.go
index 6affefe..d4bb3c3 100644
--- a/cmd/bolt/keys.go
+++ b/cmd/bolt/keys.go
@@ -13,7 +13,7 @@ func Keys(path, name string) {
return
}
- db, err := bolt.Open(path, 0600)
+ db, err := bolt.Open(path, 0600, nil)
if err != nil {
fatal(err)
return
diff --git a/cmd/bolt/main_test.go b/cmd/bolt/main_test.go
index 9b32cc8..0614d43 100644
--- a/cmd/bolt/main_test.go
+++ b/cmd/bolt/main_test.go
@@ -14,7 +14,7 @@ func open(fn func(*bolt.DB, string)) {
path := tempfile()
defer os.RemoveAll(path)
- db, err := bolt.Open(path, 0600)
+ db, err := bolt.Open(path, 0600, nil)
if err != nil {
panic("db open error: " + err.Error())
}
diff --git a/cmd/bolt/pages.go b/cmd/bolt/pages.go
index 33f6886..ec1c4b4 100644
--- a/cmd/bolt/pages.go
+++ b/cmd/bolt/pages.go
@@ -14,7 +14,7 @@ func Pages(path string) {
return
}
- db, err := bolt.Open(path, 0600)
+ db, err := bolt.Open(path, 0600, nil)
if err != nil {
fatal(err)
return
diff --git a/cmd/bolt/stats.go b/cmd/bolt/stats.go
index 54a0f44..b5d0083 100644
--- a/cmd/bolt/stats.go
+++ b/cmd/bolt/stats.go
@@ -14,7 +14,7 @@ func Stats(path, prefix string) {
return
}
- db, err := bolt.Open(path, 0600)
+ db, err := bolt.Open(path, 0600, nil)
if err != nil {
fatal(err)
return