diff options
author | Andinus <andinus@nand.sh> | 2020-03-26 23:29:48 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-03-26 23:29:48 +0530 |
commit | 7a3e2f9552a063ac99f87e47b38e3fd14919fdf0 (patch) | |
tree | 878f2714107bdfc5231a7ef7f06a1f02d4940838 /storage | |
parent | 288d04779e881cb4738ea469e4c93b841a5b42e2 (diff) | |
download | perseus-7a3e2f9552a063ac99f87e47b38e3fd14919fdf0.tar.gz |
Add auth and user package
Diffstat (limited to 'storage')
-rw-r--r-- | storage/sqlite3/db.go | 13 | ||||
-rw-r--r-- | storage/sqlite3/init.go | 8 |
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) { |