From b2a561c1569180b85d01340bd3179fa228defb92 Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Tue, 28 Aug 2018 08:20:04 -0700 Subject: [PATCH] README: add "Importing bbolt" Signed-off-by: Gyuho Lee --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 251a09f..787fec3 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,21 @@ This will retrieve the library and install the `bolt` command line utility into your `$GOBIN` path. +### Importing bbolt + +To use bbolt as an embedded key-value store, import as: + +```go +import bolt "go.etcd.io/bbolt" + +db, err := bolt.Open(path, 0666, nil) +if err != nil { + return err +} +defer db.Close() +``` + + ### Opening a database The top-level object in Bolt is a `DB`. It is represented as a single file on