2 Star 0 Fork 336

hxchjm / go-zero

forked from kevwan / go-zero 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
graceful.go 706 Bytes
一键复制 编辑 原始数据 按行查看 历史
kevwan 提交于 2020-09-18 11:41 . rename rpcx to zrpc
package main
import (
"flag"
"github.com/tal-tech/go-zero/core/conf"
"github.com/tal-tech/go-zero/example/graceful/dns/api/config"
"github.com/tal-tech/go-zero/example/graceful/dns/api/handler"
"github.com/tal-tech/go-zero/example/graceful/dns/api/svc"
"github.com/tal-tech/go-zero/rest"
"github.com/tal-tech/go-zero/zrpc"
)
var configFile = flag.String("f", "etc/graceful-api.json", "the config file")
func main() {
flag.Parse()
var c config.Config
conf.MustLoad(*configFile, &c)
client := zrpc.MustNewClient(c.Rpc)
ctx := &svc.ServiceContext{
Client: client,
}
engine := rest.MustNewServer(c.RestConf)
defer engine.Stop()
handler.RegisterHandlers(engine, ctx)
engine.Start()
}
Go
1
https://gitee.com/hxchjm/go-zero.git
git@gitee.com:hxchjm/go-zero.git
hxchjm
go-zero
go-zero
3eb88c4e4bf1

搜索帮助