feat: speedtest 网速测试服务(Go+Gin+SQLite,延迟/下载/上传 + 排行榜)

This commit is contained in:
dsh
2026-08-17 09:32:05 -04:00
commit 3b48eea5d1
15 changed files with 1855 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
package config
// Linux path prefixes
const (
LinuxEtcDir = "/etc/speedtest/"
LinuxBaseDir = "/srv/speedtest/"
)
// Windows path prefixes(本地调试用)
const (
WinEtcDir = "./win/etc/speedtest/"
WinBaseDir = "./win/srv/speedtest/"
)
// Default database settings
const (
DefaultDBDriver = "sqlite"
DefaultDSNLinux = "/srv/speedtest/speedtest.db"
DefaultDSNWin = "./win/srv/speedtest/speedtest.db"
)
// Default web listen addressunix socket,由 Caddy 反代)
const DefaultWebAddr = "/opt/speedtest/web.sock"
// Default speedtest limits(字节)
const (
DefaultMaxDownloadBytes = 100 * 1024 * 1024 // 100 MB
DefaultMaxUploadBytes = 100 * 1024 * 1024 // 100 MB
)
// ConfigFileName is the name of the configuration file
const ConfigFileName = "speedtest.toml"