Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.07 KB

README.md

File metadata and controls

33 lines (24 loc) · 1.07 KB

Bolt utils Build Status Go Report Card Coverage Status GoDoc

Bolt db wrapper for facilitating the use it low-level API.

Usage

import (
  "github.com/zhuharev/boltutils"
)

...

db, _ := boltutils.Open("path/to/db.bolt", 0666, nil)
db.Put([]byte("key"), []byte("value"))
value, _ := db.Get([]byte("key"))
// value = []byte("value")

gzip in the box

db.PutGzip([]byte("key"), []byte("value"))
value, _ := db.GetGzipped([]byte("key"))
// value = []byte("value")

json support

db.PutJSON(anyStruct)
err = db.GetJSON([]byte("bucket"), []byte("key"), &anyStruct)