/boltutils

Simple interface for bolt database

Primary LanguageGoMIT LicenseMIT

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)