From 7a3e2f9552a063ac99f87e47b38e3fd14919fdf0 Mon Sep 17 00:00:00 2001 From: Andinus Date: Thu, 26 Mar 2020 23:29:48 +0530 Subject: Add auth and user package --- storage/sqlite3/db.go | 13 +++++++++++++ storage/sqlite3/init.go | 8 -------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 storage/sqlite3/db.go (limited to 'storage') 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) { -- cgit 1.4.1-2-gfad0