save dataStore context field as reference type

This commit is contained in:
Philipp Häfelfinger 2019-03-15 23:54:22 +01:00
parent b917511e95
commit faa7a33f8f

View File

@ -7,10 +7,11 @@ import (
) )
type appContext struct { type appContext struct {
// think again if this is a good idea to have such a context!
piwigo *piwigo.PiwigoContext piwigo *piwigo.PiwigoContext
dataStore *localDataStore
sessionId string sessionId string
localRootPath string localRootPath string
dataStore localDataStore
} }
func (c *appContext) UseMetadataStore(connectionString string) error { func (c *appContext) UseMetadataStore(connectionString string) error {
@ -19,7 +20,7 @@ func (c *appContext) UseMetadataStore(connectionString string) error {
} }
logrus.Infof("Using SQL Lite data store with '%s'", connectionString) logrus.Infof("Using SQL Lite data store with '%s'", connectionString)
c.dataStore = localDataStore{} c.dataStore = &localDataStore{}
err := c.dataStore.Initialize(connectionString) err := c.dataStore.Initialize(connectionString)
return err return err