main.go 755 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package main
  2. import (
  3. "os"
  4. "runtime"
  5. "strconv"
  6. "github.com/torkelo/grafana-pro/pkg/cmd"
  7. "github.com/torkelo/grafana-pro/pkg/log"
  8. "github.com/torkelo/grafana-pro/pkg/setting"
  9. "github.com/codegangsta/cli"
  10. )
  11. var version = "master"
  12. var commit = "NA"
  13. var buildstamp string
  14. func init() {
  15. runtime.GOMAXPROCS(runtime.NumCPU())
  16. }
  17. func main() {
  18. buildstampInt64, _ := strconv.ParseInt(buildstamp, 10, 64)
  19. setting.BuildVersion = version
  20. setting.BuildCommit = commit
  21. setting.BuildStamp = buildstampInt64
  22. app := cli.NewApp()
  23. app.Name = "Grafana Backend"
  24. app.Usage = "grafana web"
  25. app.Version = version
  26. app.Commands = []cli.Command{cmd.CmdWeb, cmd.CmdImportJson}
  27. app.Flags = append(app.Flags, []cli.Flag{}...)
  28. app.Run(os.Args)
  29. log.Close()
  30. }