remove handler/util package in favour of util/router (#1908)
This commit is contained in:
parent
07a08b478f
commit
3a422231f3
4
rpc.go
4
rpc.go
@ -11,7 +11,6 @@ import (
|
|||||||
jsonpatch "github.com/evanphx/json-patch/v5"
|
jsonpatch "github.com/evanphx/json-patch/v5"
|
||||||
"github.com/micro/go-micro/v3/api"
|
"github.com/micro/go-micro/v3/api"
|
||||||
"github.com/micro/go-micro/v3/api/handler"
|
"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/api/internal/proto"
|
||||||
"github.com/micro/go-micro/v3/client"
|
"github.com/micro/go-micro/v3/client"
|
||||||
"github.com/micro/go-micro/v3/codec"
|
"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/metadata"
|
||||||
"github.com/micro/go-micro/v3/util/ctx"
|
"github.com/micro/go-micro/v3/util/ctx"
|
||||||
"github.com/micro/go-micro/v3/util/qson"
|
"github.com/micro/go-micro/v3/util/qson"
|
||||||
|
"github.com/micro/go-micro/v3/util/router"
|
||||||
"github.com/oxtoacart/bpool"
|
"github.com/oxtoacart/bpool"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ func (h *rpcHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create custom router
|
// create custom router
|
||||||
callOpt := client.WithRouter(util.Router(service.Services))
|
callOpt := client.WithRouter(router.New(service.Services))
|
||||||
|
|
||||||
// walk the standard call path
|
// walk the standard call path
|
||||||
// get payload
|
// get payload
|
||||||
|
@ -13,10 +13,10 @@ import (
|
|||||||
"github.com/gobwas/ws"
|
"github.com/gobwas/ws"
|
||||||
"github.com/gobwas/ws/wsutil"
|
"github.com/gobwas/ws/wsutil"
|
||||||
"github.com/micro/go-micro/v3/api"
|
"github.com/micro/go-micro/v3/api"
|
||||||
"github.com/micro/go-micro/v3/api/handler/util"
|
|
||||||
"github.com/micro/go-micro/v3/client"
|
"github.com/micro/go-micro/v3/client"
|
||||||
raw "github.com/micro/go-micro/v3/codec/bytes"
|
raw "github.com/micro/go-micro/v3/codec/bytes"
|
||||||
"github.com/micro/go-micro/v3/logger"
|
"github.com/micro/go-micro/v3/logger"
|
||||||
|
"github.com/micro/go-micro/v3/util/router"
|
||||||
)
|
)
|
||||||
|
|
||||||
// serveWebsocket will stream rpc back over websockets assuming json
|
// 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
|
// create custom router
|
||||||
callOpt := client.WithRouter(util.Router(service.Services))
|
callOpt := client.WithRouter(router.New(service.Services))
|
||||||
|
|
||||||
// create a new stream
|
// create a new stream
|
||||||
stream, err := c.Stream(ctx, req, callOpt)
|
stream, err := c.Stream(ctx, req, callOpt)
|
||||||
|
Loading…
Reference in New Issue
Block a user