summaryrefslogtreecommitdiffstats
path: root/lib/db/namespaced.go
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2015-10-31 12:31:25 +0100
committerJakob Borg <jakob@nym.se>2015-10-31 12:35:30 +0100
commit2a4fc28318767fe7aa10fcbe7b7fd86c5cd9a2a7 (patch)
tree4ea46aa640aea17453091612b03b91d2164ed887 /lib/db/namespaced.go
parent313485e406d633f02fcffa262f87ae75162c7160 (diff)
We should pass around db.Instance instead of leveldb.DB
We're going to need the db.Instance to keep some state, and for that to work we need the same one passed around everywhere. Hence this moves the leveldb-specific file opening stuff into the db package and exports the dbInstance type.
Diffstat (limited to 'lib/db/namespaced.go')
-rw-r--r--lib/db/namespaced.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/db/namespaced.go b/lib/db/namespaced.go
index d1b1bf15a0..eb4103f99e 100644
--- a/lib/db/namespaced.go
+++ b/lib/db/namespaced.go
@@ -17,13 +17,13 @@ import (
// NamespacedKV is a simple key-value store using a specific namespace within
// a leveldb.
type NamespacedKV struct {
- db *leveldb.DB
+ db *Instance
prefix []byte
}
// NewNamespacedKV returns a new NamespacedKV that lives in the namespace
// specified by the prefix.
-func NewNamespacedKV(db *leveldb.DB, prefix string) *NamespacedKV {
+func NewNamespacedKV(db *Instance, prefix string) *NamespacedKV {
return &NamespacedKV{
db: db,
prefix: []byte(prefix),