summary refs log tree commit diff stats
path: root/storage
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-03-26 23:29:48 +0530
committerAndinus <andinus@nand.sh>2020-03-26 23:29:48 +0530
commit7a3e2f9552a063ac99f87e47b38e3fd14919fdf0 (patch)
tree878f2714107bdfc5231a7ef7f06a1f02d4940838 /storage
parent288d04779e881cb4738ea469e4c93b841a5b42e2 (diff)
downloadperseus-7a3e2f9552a063ac99f87e47b38e3fd14919fdf0.tar.gz
Add auth and user package
Diffstat (limited to 'storage')
-rw-r--r--storage/sqlite3/db.go13
-rw-r--r--storage/sqlite3/init.go8
2 files changed, 13 insertions, 8 deletions
diff --git a/storage/sqlite3/db.go b/storage/sqlite3/db.go
new file mode 100644
index 0000000..e949bba
--- /dev/null
+++ b/storage/sqlite3/db.go
@@ -0,0 +1,13 @@
+package sqlite3
+
+import (
+	"database/sql"
+	"sync"
+)
+
+// DB holds the database connection, mutex & path.
+type DB struct {
+	Path string
+	Mu   *sync.RWMutex
+	Conn *sql.DB
+}
diff --git a/storage/sqlite3/init.go b/storage/sqlite3/init.go
index cb573a2..01ffb9e 100644
--- a/storage/sqlite3/init.go
+++ b/storage/sqlite3/init.go
@@ -4,18 +4,10 @@ import (
 	"database/sql"
 	"log"
 	"os"
-	"sync"
 
 	_ "github.com/mattn/go-sqlite3"
 )
 
-// DB holds the database connection, mutex & path.
-type DB struct {
-	Path string
-	Mu   *sync.RWMutex
-	Conn *sql.DB
-}
-
 // initErr will log the error and close the database connection if
 // necessary.
 func initErr(db *DB, err error) {