allow redis to be selected as session store type

This commit is contained in:
Gregory Wells
2026-06-07 20:02:12 -04:00
parent 9c984fefaf
commit e1862ca8eb
4 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -213,7 +213,7 @@ func changePasswordHandler(w http.ResponseWriter, r *http.Request) {
func main() {
logging.Info("Starting the server")
sessionManager = session.GetSessionManager()
sessionManager.SetStoreType(session.InMemory)
sessionManager.SetStoreType(session.Redis)
var err error
serverConfig, err = loadServerConfig("./data/config.json")
+6
View File
@@ -21,6 +21,7 @@ type StoreType int
const (
InMemory StoreType = iota
Redis
)
func GetSessionManager() *SessionManager {
@@ -38,6 +39,11 @@ func (manager *SessionManager) SetStoreType(storeType StoreType) {
manager.store = NewMemoryStore()
break
}
case Redis:
{
manager.store = NewRedisStore()
break
}
}
}