1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00
ctrl/cmd/steward/main.go
2021-06-08 04:02:23 +02:00

38 lines
511 B
Go

package main
import (
"log"
"net/http"
"os"
_ "net/http/pprof"
"github.com/RaaLabs/steward"
)
func main() {
c := steward.NewConfiguration()
err := c.CheckFlags()
if err != nil {
log.Printf("%v\n", err)
return
}
// Start profiling if profiling port is specified
if c.ProfilingPort != "" {
go func() {
http.ListenAndServe("localhost:"+c.ProfilingPort, nil)
}()
}
s, err := steward.NewServer(c)
if err != nil {
log.Printf("%v\n", err)
os.Exit(1)
}
go s.Start()
select {}
}