diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2017-06-12 23:52:26 -0400 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2017-06-12 23:52:26 -0400 |
| commit | a38f778312b392614ec0ccf14f9f2790671b63eb (patch) | |
| tree | 202dd4df5d1418c285c348f2f1366d339f99a6f0 /main.go | |
| parent | a8684a6aade6bac962da35a96e14667cca3c44c5 (diff) | |
| download | lastfm-api-a38f778312b392614ec0ccf14f9f2790671b63eb.tar.gz | |
Abstract all DB access via DataStore, fix lfm_password bug
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 3 |
1 files changed, 0 insertions, 3 deletions
@@ -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() |
