Update naming for better clarity (#155)

* Rename

* update naming
This commit is contained in:
giongto35 2020-03-22 23:34:23 +08:00 committed by GitHub
parent 10cb6d5092
commit 2cd48e0342
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 170 additions and 266 deletions

View file

@ -1,43 +0,0 @@
package main
import (
"context"
"math/rand"
"os"
"os/signal"
"time"
"github.com/giongto35/cloud-game/pkg/overlord"
"github.com/giongto35/cloud-game/pkg/util/logging"
"github.com/golang/glog"
"github.com/spf13/pflag"
)
func main() {
rand.Seed(time.Now().UTC().UnixNano())
cfg := overlord.NewDefaultConfig()
cfg.AddFlags(pflag.CommandLine)
logging.Init()
defer logging.Flush()
ctx, cancelCtx := context.WithCancel(context.Background())
glog.Infof("Initializing overlord server")
glog.V(4).Infof("Overlord configs %v", cfg)
o := overlord.New(ctx, cfg)
if err := o.Run(); err != nil {
glog.Errorf("Failed to run overlord server, reason %v", err)
os.Exit(1)
}
stop := make(chan os.Signal, 1)
signal.Notify(stop, os.Interrupt)
select {
case <-stop:
glog.Infoln("Received SIGTERM, Quiting Overlord")
o.Shutdown()
cancelCtx()
}
}