roscopecoltran / boltutils

Simple interface for bolt database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:MIT License


Languages

Language:Go 100.0%