Support in-memory telemetry/stats database

This commit is contained in:
Maddie Zhan
2021-09-18 02:19:14 +08:00
parent 800760054e
commit 89a5de0105
4 changed files with 56 additions and 2 deletions
+3
View File
@@ -3,6 +3,7 @@ package database
import (
"github.com/librespeed/speedtest/config"
"github.com/librespeed/speedtest/database/bolt"
"github.com/librespeed/speedtest/database/memory"
"github.com/librespeed/speedtest/database/mysql"
"github.com/librespeed/speedtest/database/none"
"github.com/librespeed/speedtest/database/postgresql"
@@ -29,6 +30,8 @@ func SetDBInfo(conf *config.Config) {
DB = mysql.Open(conf.DatabaseHostname, conf.DatabaseUsername, conf.DatabasePassword, conf.DatabaseName)
case "bolt":
DB = bolt.Open(conf.DatabaseFile)
case "memory":
DB = memory.Open("")
case "none":
DB = none.Open("")
default: