aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2015-05-18 13:50:00 -0600
committerBen Johnson <benbjohnson@yahoo.com>2015-05-18 13:50:00 -0600
commit957d850b5158a4eebf915476058e720f43459584 (patch)
tree1b32c5c443271625c41ce55394f4e4bb1a58d664
parentMerge branch 'ro' (diff)
downloaddedo-957d850b5158a4eebf915476058e720f43459584.tar.gz
dedo-957d850b5158a4eebf915476058e720f43459584.tar.xz
README
-rw-r--r--README.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/README.md b/README.md
index b76a473..c828200 100644
--- a/README.md
+++ b/README.md
@@ -446,6 +446,21 @@ It's also useful to pipe these stats to a service such as statsd for monitoring
or to provide an HTTP endpoint that will perform a fixed-length sample.
+### Read-Only Mode
+
+Sometimes it is useful to create a shared, read-only Bolt database. To this,
+set the `Options.ReadOnly` flag when opening your database. Read-only mode
+uses a shared lock to allow multiple processes to read from the database but
+it will block any processes from opening the database in read-write mode.
+
+```go
+db, err := bolt.Open("my.db", 0666, &bolt.Options{ReadOnly: true})
+if err != nil {
+ log.Fatal(err)
+}
+```
+
+
## Resources
For more information on getting started with Bolt, check out the following articles: