Registry router fixes (#1961)
* only cache routes if told to do so * Use roundrobin selector and retry in proxy * Update lookup to require service * Fix compile * Fix compile * Update * Update * rename query to lookup * Update router.go * Update
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/micro/go-micro/v3/router"
|
||||
"github.com/micro/go-micro/v3/selector"
|
||||
)
|
||||
|
||||
@@ -15,7 +14,7 @@ type roundTripper struct {
|
||||
}
|
||||
|
||||
func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||
routes, err := r.opts.Router.Lookup(router.QueryService(req.URL.Host))
|
||||
routes, err := r.opts.Router.Lookup(req.URL.Host)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@ type apiRouter struct {
|
||||
router.Router
|
||||
}
|
||||
|
||||
func (r *apiRouter) Lookup(...router.QueryOption) ([]router.Route, error) {
|
||||
func (r *apiRouter) Lookup(service string, opts ...router.LookupOption) ([]router.Route, error) {
|
||||
return r.routes, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user