Deprecate client/selector (#1767)

* client/{grpc,rpc}: depricate selector (wip)

* {client,cmd}: remove client/selector

* deprecate client/selector

* router/static: fix lookup

* config/cmd: add support for legacy static selector flag

* config/cmd: add support for legacy dns selector flag
This commit is contained in:
ben-toogood
2020-07-01 17:06:59 +01:00
committed by GitHub
parent a63480a81a
commit 174e44b846
46 changed files with 428 additions and 1572 deletions

View File

@@ -11,7 +11,6 @@ import (
"time"
"github.com/micro/go-micro/v2/client"
"github.com/micro/go-micro/v2/client/selector"
"github.com/micro/go-micro/v2/codec"
"github.com/micro/go-micro/v2/codec/bytes"
"github.com/micro/go-micro/v2/errors"
@@ -19,6 +18,7 @@ import (
"github.com/micro/go-micro/v2/metadata"
"github.com/micro/go-micro/v2/proxy"
"github.com/micro/go-micro/v2/router"
"github.com/micro/go-micro/v2/selector/roundrobin"
"github.com/micro/go-micro/v2/server"
)
@@ -394,7 +394,7 @@ func (p *Proxy) ServeRequest(ctx context.Context, req server.Request, rsp server
//nolint:prealloc
opts := []client.CallOption{
// set strategy to round robin
client.WithSelectOption(selector.WithStrategy(selector.RoundRobin)),
client.WithSelector(roundrobin.NewSelector()),
}
// if the address is already set just serve it