From 3a422231f32465dad09e7ee0b26a94279685b73a Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Fri, 7 Aug 2020 12:47:20 +0100 Subject: [PATCH] remove handler/util package in favour of util/router (#1908) --- rpc.go | 4 ++-- stream.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rpc.go b/rpc.go index f51e7a6..5a22ed5 100644 --- a/rpc.go +++ b/rpc.go @@ -11,7 +11,6 @@ import ( jsonpatch "github.com/evanphx/json-patch/v5" "github.com/micro/go-micro/v3/api" "github.com/micro/go-micro/v3/api/handler" - "github.com/micro/go-micro/v3/api/handler/util" "github.com/micro/go-micro/v3/api/internal/proto" "github.com/micro/go-micro/v3/client" "github.com/micro/go-micro/v3/codec" @@ -22,6 +21,7 @@ import ( "github.com/micro/go-micro/v3/metadata" "github.com/micro/go-micro/v3/util/ctx" "github.com/micro/go-micro/v3/util/qson" + "github.com/micro/go-micro/v3/util/router" "github.com/oxtoacart/bpool" ) @@ -113,7 +113,7 @@ func (h *rpcHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } // create custom router - callOpt := client.WithRouter(util.Router(service.Services)) + callOpt := client.WithRouter(router.New(service.Services)) // walk the standard call path // get payload diff --git a/stream.go b/stream.go index 1078cdc..25d6789 100644 --- a/stream.go +++ b/stream.go @@ -13,10 +13,10 @@ import ( "github.com/gobwas/ws" "github.com/gobwas/ws/wsutil" "github.com/micro/go-micro/v3/api" - "github.com/micro/go-micro/v3/api/handler/util" "github.com/micro/go-micro/v3/client" raw "github.com/micro/go-micro/v3/codec/bytes" "github.com/micro/go-micro/v3/logger" + "github.com/micro/go-micro/v3/util/router" ) // serveWebsocket will stream rpc back over websockets assuming json @@ -111,7 +111,7 @@ func serveWebsocket(ctx context.Context, w http.ResponseWriter, r *http.Request, ) // create custom router - callOpt := client.WithRouter(util.Router(service.Services)) + callOpt := client.WithRouter(router.New(service.Services)) // create a new stream stream, err := c.Stream(ctx, req, callOpt)