update all deps to latest versions

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-01-29 16:47:26 +03:00
parent 3876ba5705
commit ac192b7ef5
21 changed files with 338 additions and 165 deletions

View File

@@ -7,7 +7,7 @@ import (
"testing"
"github.com/sony/gobreaker"
"github.com/unistack-org/micro/registry/memory"
"github.com/unistack-org/micro/register/memory"
"github.com/unistack-org/micro/v3/client"
"github.com/unistack-org/micro/v3/errors"
"github.com/unistack-org/micro/v3/router"
@@ -15,11 +15,11 @@ import (
func TestBreaker(t *testing.T) {
// setup
r := memory.NewRegistry()
r := memory.NewRegister()
c := client.NewClient(
// set the selector
client.Router(rrouter.NewRouter(router.Registry(registry))),
client.Router(rrouter.NewRouter(router.Register(register))),
// add the breaker wrapper
client.Wrap(NewClientWrapper()),
)
@@ -48,11 +48,11 @@ func TestBreaker(t *testing.T) {
func TestCustomBreaker(t *testing.T) {
// setup
r := memory.NewRegistry()
r := memory.NewRegister()
c := client.NewClient(
// set the selector
client.Router(rrouter.NewRouter(router.Registry(registry))),
client.Router(rrouter.NewRouter(router.Register(register))),
// add the breaker wrapper
client.Wrap(NewCustomClientWrapper(
gobreaker.Settings{},

View File

@@ -7,19 +7,19 @@ import (
"testing"
"github.com/afex/hystrix-go/hystrix"
rrouter "github.com/unistack-org/micro-router-registry/v3"
"github.com/unistack-org/micro/registry/memory"
rrouter "github.com/unistack-org/micro-router-register/v3"
"github.com/unistack-org/micro/register/memory"
"github.com/unistack-org/micro/v3/client"
"github.com/unistack-org/micro/v3/router"
)
func TestBreaker(t *testing.T) {
// setup
registry := memory.NewRegistry()
register := memory.NewRegister()
c := client.NewClient(
// set the selector
client.Router(rrouter.NewRouter(router.Registry(registry))),
client.Router(rrouter.NewRouter(router.Register(register))),
// add the breaker wrapper
client.Wrap(NewClientWrapper()),
)

View File

@@ -12,8 +12,8 @@ import (
cli "github.com/unistack-org/micro-client-grpc/v3"
jsoncodec "github.com/unistack-org/micro-codec-json/v3"
promwrapper "github.com/unistack-org/micro-metrics-prometheus/v3"
rmemory "github.com/unistack-org/micro-registry-memory/v3"
rrouter "github.com/unistack-org/micro-router-registry/v3"
rmemory "github.com/unistack-org/micro-register-memory/v3"
rrouter "github.com/unistack-org/micro-router-register/v3"
srv "github.com/unistack-org/micro-server-grpc/v3"
"github.com/unistack-org/micro/v3/broker"
"github.com/unistack-org/micro/v3/client"
@@ -42,13 +42,13 @@ func (t *testHandler) Method(ctx context.Context, req *TestRequest, rsp *TestRes
func TestPrometheusMetrics(t *testing.T) {
client.DefaultRetries = 0
// setup
reg := rmemory.NewRegistry()
brk := bmemory.NewBroker(broker.Registry(reg))
reg := rmemory.NewRegister()
brk := bmemory.NewBroker(broker.Register(reg))
name := "test"
id := "id-1234567890"
version := "1.2.3.4"
rt := rrouter.NewRouter(router.Registry(reg))
rt := rrouter.NewRouter(router.Register(reg))
c := cli.NewClient(
client.Codec("application/grpc+json", jsoncodec.NewCodec()),
@@ -61,7 +61,7 @@ func TestPrometheusMetrics(t *testing.T) {
server.Name(name),
server.Version(version),
server.Id(id),
server.Registry(reg),
server.Register(reg),
server.Broker(brk),
server.WrapHandler(
promwrapper.NewHandlerWrapper(

View File

@@ -11,8 +11,8 @@ import (
"github.com/juju/ratelimit"
bmemory "github.com/unistack-org/micro-broker-memory/v3"
tmemory "github.com/unistack-org/micro-network-transport-memory"
rmemory "github.com/unistack-org/micro-registry-memory/v3"
rrouter "github.com/unistack-org/micro-router-registry/v3"
rmemory "github.com/unistack-org/micro-register-memory/v3"
rrouter "github.com/unistack-org/micro-router-register/v3"
"github.com/unistack-org/micro/v3/client"
"github.com/unistack-org/micro/v3/errors"
"github.com/unistack-org/micro/v3/router"
@@ -29,7 +29,7 @@ func (t *testHandler) Method(ctx context.Context, req *TestRequest, rsp *TestRes
func TestRateClientLimit(t *testing.T) {
// setup
r := rmemory.NewRegistry()
r := rmemory.NewRegister()
tr := tmemory.NewTransport()
testRates := []int{1, 10, 20}
@@ -37,7 +37,7 @@ func TestRateClientLimit(t *testing.T) {
b := ratelimit.NewBucketWithRate(float64(limit), int64(limit))
c := client.NewClient(
client.Router(rrouter.NewRouter(router.Registry(registry))),
client.Router(rrouter.NewRouter(router.Register(register))),
client.Transport(tr),
// add the breaker wrapper
client.Wrap(NewClientWrapper(b, false)),
@@ -72,22 +72,22 @@ func TestRateServerLimit(t *testing.T) {
testRates := []int{1, 5, 6, 10}
for _, limit := range testRates {
r := rmemory.NewRegistry()
r := rmemory.NewRegister()
b := bmemory.NewBroker()
tr := tmemory.NewTransport()
_ = b
br := ratelimit.NewBucketWithRate(float64(limit), int64(limit))
c := client.NewClient(
client.Router(rrouter.NewRouter(router.Registry(registry))),
client.Router(rrouter.NewRouter(router.Register(register))),
client.Transport(tr))
name := fmt.Sprintf("test.service.%d", limit)
srv := server.NewServer(
server.Name(name),
// add registry
server.Registry(r),
// add register
server.Register(r),
server.Transport(tr),
// add broker
//server.Broker(b),

View File

@@ -8,8 +8,8 @@ import (
"testing"
"github.com/stretchr/testify/assert"
rrouter "github.com/unistack-org/micro-router-registry/v3"
"github.com/unistack-org/micro/registry/memory"
rrouter "github.com/unistack-org/micro-router-register/v3"
"github.com/unistack-org/micro/register/memory"
"github.com/unistack-org/micro/v3/client"
microerr "github.com/unistack-org/micro/v3/errors"
"github.com/unistack-org/micro/v3/router"
@@ -71,14 +71,14 @@ func TestClient(t *testing.T) {
mt := mocktracer.Start()
defer mt.Stop()
registry := memory.NewRegistry()
register := memory.NewRegister()
serverName := "micro.server.name"
serverID := "id-1234567890"
serverVersion := "1.0.0"
c := cli.NewClient(
client.Router(rrouter.NewRouter(router.Registry(registry))),
client.Router(rrouter.NewRouter(router.Register(register))),
client.WrapCall(NewCallWrapper()),
)
@@ -86,7 +86,7 @@ func TestClient(t *testing.T) {
server.Name(serverName),
server.Version(serverVersion),
server.Id(serverID),
server.Registry(registry),
server.Register(register),
server.WrapSubscriber(NewSubscriberWrapper()),
server.WrapHandler(NewHandlerWrapper()),
)
@@ -151,14 +151,14 @@ func TestRace(t *testing.T) {
mt := mocktracer.Start()
defer mt.Stop()
registry := memory.NewRegistry()
register := memory.NewRegister()
serverName := "micro.server.name"
serverID := "id-1234567890"
serverVersion := "1.0.0"
c := cli.NewClient(
client.Router(rrouter.NewRouter(router.Registry(registry))),
client.Router(rrouter.NewRouter(router.Register(register))),
client.WrapCall(NewCallWrapper()),
)
@@ -166,7 +166,7 @@ func TestRace(t *testing.T) {
server.Name(serverName),
server.Version(serverVersion),
server.Id(serverID),
server.Registry(registry),
server.Register(register),
server.WrapSubscriber(NewSubscriberWrapper()),
server.WrapHandler(NewHandlerWrapper()),
)

View File

@@ -11,8 +11,8 @@ import (
rbroker "github.com/unistack-org/micro-broker-memory/v3"
cli "github.com/unistack-org/micro-client-grpc/v3"
jsoncodec "github.com/unistack-org/micro-codec-json/v3"
rmemory "github.com/unistack-org/micro-registry-memory/v3"
rrouter "github.com/unistack-org/micro-router-registry/v3"
rmemory "github.com/unistack-org/micro-register-memory/v3"
rrouter "github.com/unistack-org/micro-router-register/v3"
srv "github.com/unistack-org/micro-server-grpc/v3"
otwrapper "github.com/unistack-org/micro-wrapper-trace-opentracing/v3"
"github.com/unistack-org/micro/v3/broker"
@@ -70,14 +70,14 @@ func TestClient(t *testing.T) {
t.Run(name, func(t *testing.T) {
tracer := mocktracer.New()
reg := rmemory.NewRegistry()
brk := rbroker.NewBroker(broker.Registry(reg))
reg := rmemory.NewRegister()
brk := rbroker.NewBroker(broker.Register(reg))
serverName := "micro.server.name"
serverID := "id-1234567890"
serverVersion := "1.0.0"
rt := rrouter.NewRouter(router.Registry(reg))
rt := rrouter.NewRouter(router.Register(reg))
c := cli.NewClient(
client.Codec("application/grpc+json", jsoncodec.NewCodec()),
@@ -92,7 +92,7 @@ func TestClient(t *testing.T) {
server.Name(serverName),
server.Version(serverVersion),
server.Id(serverID),
server.Registry(reg),
server.Register(reg),
server.Broker(brk),
server.WrapSubscriber(otwrapper.NewServerSubscriberWrapper(otwrapper.WithTracer(tracer))),
server.WrapHandler(otwrapper.NewServerHandlerWrapper(otwrapper.WithTracer(tracer))),