OSDN Git Service
(root)
/
bytom
/
vapor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a072d52
)
modify NewDB
author
Chengcheng Zhang
<943420582@qq.com>
Wed, 19 Jun 2019 13:35:20 +0000
(21:35 +0800)
committer
Chengcheng Zhang
<943420582@qq.com>
Wed, 19 Jun 2019 13:35:20 +0000
(21:35 +0800)
database/builder.go
[new file with mode: 0644]
patch
|
blob
diff --git a/database/builder.go
b/database/builder.go
new file mode 100644
(file)
index 0000000..
ae2f4c8
--- /dev/null
+++ b/
database/builder.go
@@ -0,0
+1,14
@@
+package database
+
+import (
+ "github.com/vapor/database/dbutils"
+ dbm "github.com/vapor/database/leveldb"
+)
+
+// NewDB return new DB according to backend, defult is "leveldb"
+func NewDB(name string, backend string, dir string) dbutils.DB {
+ switch backend {
+ default: // default is "leveldb"
+ return dbm.NewDB(name, "leveldb", dir)
+ }
+}