speedtest-go/main.go
Maddie Zhan 800760054e Embed tzdata and rootcerts in binary
For use in environments without tzdata or root certs (like embedded devices)

Fixes #29
2021-09-18 01:58:35 +08:00

28 lines
590 B
Go

package main
import (
"flag"
_ "time/tzdata"
"github.com/librespeed/speedtest/config"
"github.com/librespeed/speedtest/database"
"github.com/librespeed/speedtest/results"
"github.com/librespeed/speedtest/web"
_ "github.com/breml/rootcerts"
log "github.com/sirupsen/logrus"
)
var (
optConfig = flag.String("c", "", "config file to be used, defaults to settings.toml in the same directory")
)
func main() {
flag.Parse()
conf := config.Load(*optConfig)
web.SetServerLocation(&conf)
results.Initialize(&conf)
database.SetDBInfo(&conf)
log.Fatal(web.ListenAndServe(&conf))
}