Create metadata db object

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan
2017-09-22 10:05:35 -07:00
parent acba0f50ef
commit 56c1b79a4c
14 changed files with 56 additions and 30 deletions

21
metadata/db.go Normal file
View File

@@ -0,0 +1,21 @@
package metadata
import "github.com/boltdb/bolt"
type DB struct {
db *bolt.DB
}
func NewDB(db *bolt.DB) *DB {
return &DB{
db: db,
}
}
func (m *DB) View(fn func(*bolt.Tx) error) error {
return m.db.View(fn)
}
func (m *DB) Update(fn func(*bolt.Tx) error) error {
return m.db.Update(fn)
}