qrz/cmd/qrz/qrz.go
Paul Lecuq cca6c96626
Some checks failed
continuous-integration/drone/push Build is failing
code cleaning and performances improvements
2020-12-27 15:07:06 +01:00

50 lines
836 B
Go

//go:generate packr2 -v
package main
import (
"log"
"git.paulbsd.com/paulbsd/qrz/src/config"
"git.paulbsd.com/paulbsd/qrz/src/database"
"git.paulbsd.com/paulbsd/qrz/src/qrz"
"git.paulbsd.com/paulbsd/qrz/src/qrzws"
"github.com/gobuffalo/packr/v2"
_ "github.com/lib/pq"
_ "github.com/spf13/cobra"
)
var version string
func main() {
var cfg config.Config
cfg.GetConfig()
cfg.Version = version
// Generate static files embedding
PackrGen()
err := database.Initialize(&cfg)
if err != nil {
log.Fatalln(err)
}
defer cfg.Db.Close()
err = qrz.InitCronConfig(cfg)
if err != nil {
log.Println(err)
}
err = qrzws.RunServer(cfg)
if err != nil {
log.Println(err)
}
}
// PackrGen act as an assets bundle maker
func PackrGen() {
packr.New("static", "../../static")
packr.New("templates", "../../templates")
}