rename ngin to rest

This commit is contained in:
kevin
2020-07-31 11:45:16 +08:00
parent 0897f60c5d
commit f372ded63c
25 changed files with 112 additions and 119 deletions

View File

@@ -3,5 +3,5 @@ package config
import "zero/rest"
type Config struct {
rest.RtConf
rest.RestConf
}

View File

@@ -17,7 +17,7 @@ func main() {
var c config.Config
conf.MustLoad(*configFile, &c)
engine := rest.MustNewEngine(c.RtConf)
engine := rest.MustNewServer(c.RestConf)
defer engine.Stop()
handler.RegisterHandlers(engine)

View File

@@ -6,7 +6,7 @@ import (
"zero/rest"
)
func RegisterHandlers(engine *rest.Engine) {
func RegisterHandlers(engine *rest.Server) {
engine.AddRoutes([]rest.Route{
{
Method: http.MethodGet,

View File

@@ -18,7 +18,7 @@ import (
)
type Config struct {
rest.RtConf
rest.RestConf
}
`
)

View File

@@ -30,7 +30,7 @@ func main() {
ctx := svc.NewServiceContext(c)
engine := rest.MustNewEngine(c.RtConf)
engine := rest.MustNewEngine(c.RestConf)
defer engine.Stop()
handler.RegisterHandlers(engine, ctx)