aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2017-06-12 23:52:26 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2017-06-12 23:52:26 -0400
commita38f778312b392614ec0ccf14f9f2790671b63eb (patch)
tree202dd4df5d1418c285c348f2f1366d339f99a6f0 /main.go
parenta8684a6aade6bac962da35a96e14667cca3c44c5 (diff)
downloadlastfm-api-a38f778312b392614ec0ccf14f9f2790671b63eb.tar.gz
Abstract all DB access via DataStore, fix lfm_password bug
Diffstat (limited to 'main.go')
-rw-r--r--main.go3
1 files changed, 0 insertions, 3 deletions
diff --git a/main.go b/main.go
index c4e5cd9..6080b69 100644
--- a/main.go
+++ b/main.go
@@ -19,7 +19,6 @@ type handler func(DataStore, http.ResponseWriter, *http.Request)
type App struct {
DataStore
- DB *sql.DB
Config *Config
CookieHandler *securecookie.SecureCookie
Template *template.Template
@@ -33,7 +32,6 @@ func New() *App {
if err = db.Ping(); err != nil {
log.Fatal(err)
}
- app.DB = db
app.DataStore = &SqlStore{db}
hashKey, err := hex.DecodeString(config.HashKey)
blockKey, err := hex.DecodeString(config.BlockKey)
@@ -85,7 +83,6 @@ func (app *App) InitWebServer() *http.Server {
func main() {
log.SetFlags(log.LstdFlags | log.Lshortfile)
app := New()
- defer app.DB.Close()
apiServer := app.InitApiServer()
webServer := app.InitWebServer()