Skip to content

zhuharev/boltutils

Repository files navigation

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)

About

Simple interface for bolt database

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages