mirror of
https://github.com/etcd-io/bbolt.git
synced 2025-04-05 00:09:36 +00:00
README: add "Importing bbolt"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
This commit is contained in:
parent
5912526255
commit
b2a561c156
15
README.md
15
README.md
@ -81,6 +81,21 @@ This will retrieve the library and install the `bolt` command line utility into
|
|||||||
your `$GOBIN` path.
|
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
|
### Opening a database
|
||||||
|
|
||||||
The top-level object in Bolt is a `DB`. It is represented as a single file on
|
The top-level object in Bolt is a `DB`. It is represented as a single file on
|
||||||
|
Loading…
x
Reference in New Issue
Block a user