-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.go
35 lines (32 loc) · 886 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"github.com/go-chassis/go-chassis"
"github.com/go-mesh/openlogging"
"github.com/go-mesh/registrator/cmd"
"github.com/go-mesh/registrator/config"
"github.com/go-mesh/registrator/reg"
"github.com/go-mesh/registrator/resource"
_ "github.com/huaweicse/auth/adaptor/gochassis"
)
func main() {
var err error
if err := chassis.Init(); err != nil {
openlogging.Error(err.Error())
}
chassis.RegisterSchema("rest", &resource.Admin{})
if err := cmd.ReadParams(); err != nil {
openlogging.Fatal("can not init CLI: " + err.Error())
}
if err := config.Init(); err != nil {
openlogging.Fatal("can not read config: " + err.Error())
}
if err != nil {
openlogging.Warn("can not sign request: " + err.Error())
}
go func() {
if err := reg.Start(); err != nil {
openlogging.Fatal("can not start registrator: " + err.Error())
}
}()
chassis.Run()
}