fix example tracing edge config (#76)

This commit is contained in:
Zhang Hao
2020-09-18 08:53:06 +08:00
committed by GitHub
parent 1e5e9d63bd
commit 26e16107ce
2 changed files with 19 additions and 4 deletions

View File

@@ -18,6 +18,11 @@ var (
client rpcx.Client
)
type Config struct {
rest.RestConf
Portal rpcx.RpcClientConf
}
func handle(w http.ResponseWriter, r *http.Request) {
conn := client.Conn()
greet := portal.NewPortalClient(conn)
@@ -34,16 +39,16 @@ func handle(w http.ResponseWriter, r *http.Request) {
func main() {
flag.Parse()
var c rpcx.RpcClientConf
var c Config
conf.MustLoad(*configFile, &c)
client = rpcx.MustNewClient(c)
client = rpcx.MustNewClient(c.Portal)
engine := rest.MustNewServer(rest.RestConf{
ServiceConf: service.ServiceConf{
Log: logx.LogConf{
Mode: "console",
},
},
Port: 3333,
Port: c.Port,
})
defer engine.Stop()