Files
speedtest/config/defaults.go
T

35 lines
947 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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(字节)
// 前端测速为自适应负载(单轮目标 ~2 秒、阶段最短 5 秒),
// 高速连接下负载会翻倍增长,因此上限放宽到 512 MB
const (
DefaultMaxDownloadBytes = 512 * 1024 * 1024 // 512 MB
DefaultMaxUploadBytes = 512 * 1024 * 1024 // 512 MB
)
// ConfigFileName is the name of the configuration file
const ConfigFileName = "speedtest.toml"