rename ngin to rest

This commit is contained in:
kevin
2020-07-31 11:14:48 +08:00
parent e133ffd820
commit 0897f60c5d
78 changed files with 118 additions and 111 deletions

View File

@@ -1,11 +1,11 @@
package config
import (
"zero/ngin"
"zero/rest"
"zero/rpcx"
)
type Config struct {
ngin.NgConf
rest.RtConf
Rpc rpcx.RpcClientConf
}

View File

@@ -7,7 +7,7 @@ import (
"zero/example/graceful/dns/api/config"
"zero/example/graceful/dns/api/handler"
"zero/example/graceful/dns/api/svc"
"zero/ngin"
"zero/rest"
"zero/rpcx"
)
@@ -24,7 +24,7 @@ func main() {
Client: client,
}
engine := ngin.MustNewEngine(c.NgConf)
engine := rest.MustNewEngine(c.RtConf)
defer engine.Stop()
handler.RegisterHandlers(engine, ctx)

View File

@@ -12,7 +12,7 @@ import (
"zero/example/graceful/dns/api/svc"
"zero/example/graceful/dns/api/types"
"zero/example/graceful/dns/rpc/graceful"
"zero/ngin/httpx"
"zero/rest/httpx"
)
func gracefulHandler(ctx *svc.ServiceContext) http.HandlerFunc {

View File

@@ -5,11 +5,11 @@ import (
"net/http"
"zero/example/graceful/dns/api/svc"
"zero/ngin"
"zero/rest"
)
func RegisterHandlers(engine *ngin.Engine, ctx *svc.ServiceContext) {
engine.AddRoutes([]ngin.Route{
func RegisterHandlers(engine *rest.Engine, ctx *svc.ServiceContext) {
engine.AddRoutes([]rest.Route{
{
Method: http.MethodGet,
Path: "/api/graceful",

View File

@@ -1,11 +1,11 @@
package config
import (
"zero/ngin"
"zero/rest"
"zero/rpcx"
)
type Config struct {
ngin.NgConf
rest.RtConf
Rpc rpcx.RpcClientConf
}

View File

@@ -7,7 +7,7 @@ import (
"zero/example/graceful/etcd/api/config"
"zero/example/graceful/etcd/api/handler"
"zero/example/graceful/etcd/api/svc"
"zero/ngin"
"zero/rest"
"zero/rpcx"
)
@@ -24,7 +24,7 @@ func main() {
Client: client,
}
engine := ngin.MustNewEngine(c.NgConf)
engine := rest.MustNewEngine(c.RtConf)
defer engine.Stop()
handler.RegisterHandlers(engine, ctx)

View File

@@ -12,7 +12,7 @@ import (
"zero/example/graceful/etcd/api/svc"
"zero/example/graceful/etcd/api/types"
"zero/example/graceful/etcd/rpc/graceful"
"zero/ngin/httpx"
"zero/rest/httpx"
)
func gracefulHandler(ctx *svc.ServiceContext) http.HandlerFunc {

View File

@@ -5,11 +5,11 @@ import (
"net/http"
"zero/example/graceful/etcd/api/svc"
"zero/ngin"
"zero/rest"
)
func RegisterHandlers(engine *ngin.Engine, ctx *svc.ServiceContext) {
engine.AddRoutes([]ngin.Route{
func RegisterHandlers(engine *rest.Engine, ctx *svc.ServiceContext) {
engine.AddRoutes([]rest.Route{
{
Method: http.MethodGet,
Path: "/api/graceful",