Rod is a simple way to put and get values to/from a BoltDB store. It can deal with deep-hierarchies easily and is therefore a rod straight to the value you want.
go get github.com/chilts/rod
Or (for gb
):
gb vendor fetch github.com/chilts/rod
user := User{
Name: "chilts",
Email: "andychilton@gmail.com",
Logins: 1,
Inserted: time.Now(),
}
db.Update(func(tx *bolt.TX) error {
return rod.PutJson(tx, "users.chilts", "chilts", user)
})
By Andrew Chilton, @twitter.
For AppsAttic, @AppsAttic.
MIT.
(Ends)