From 046db9e1786e2f6a07951174efd67195eccb2c71 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Mon, 27 Jul 2020 13:22:00 +0100 Subject: [PATCH] v3 refactor (#1868) * Move to v3 Co-authored-by: Ben Toogood --- codec.go | 4 ++-- error.go | 2 +- grpc.go | 12 ++++++------ grpc_test.go | 13 +++++++------ message.go | 2 +- options.go | 2 +- request.go | 4 ++-- response.go | 4 ++-- stream.go | 2 +- 9 files changed, 23 insertions(+), 22 deletions(-) diff --git a/codec.go b/codec.go index e5a6730..c377545 100644 --- a/codec.go +++ b/codec.go @@ -9,8 +9,8 @@ import ( "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" - "github.com/micro/go-micro/v2/codec" - "github.com/micro/go-micro/v2/codec/bytes" + "github.com/micro/go-micro/v3/codec" + "github.com/micro/go-micro/v3/codec/bytes" "github.com/oxtoacart/bpool" "google.golang.org/grpc" "google.golang.org/grpc/encoding" diff --git a/error.go b/error.go index 8088c55..7b690b3 100644 --- a/error.go +++ b/error.go @@ -1,7 +1,7 @@ package grpc import ( - "github.com/micro/go-micro/v2/errors" + "github.com/micro/go-micro/v3/errors" "google.golang.org/grpc/status" ) diff --git a/grpc.go b/grpc.go index 85b2125..2ed71bd 100644 --- a/grpc.go +++ b/grpc.go @@ -11,12 +11,12 @@ import ( "sync/atomic" "time" - "github.com/micro/go-micro/v2/broker" - "github.com/micro/go-micro/v2/client" - raw "github.com/micro/go-micro/v2/codec/bytes" - "github.com/micro/go-micro/v2/errors" - "github.com/micro/go-micro/v2/metadata" - "github.com/micro/go-micro/v2/registry" + "github.com/micro/go-micro/v3/broker" + "github.com/micro/go-micro/v3/client" + raw "github.com/micro/go-micro/v3/codec/bytes" + "github.com/micro/go-micro/v3/errors" + "github.com/micro/go-micro/v3/metadata" + "github.com/micro/go-micro/v3/registry" "google.golang.org/grpc" "google.golang.org/grpc/credentials" diff --git a/grpc_test.go b/grpc_test.go index bbec1b4..1b05ae8 100644 --- a/grpc_test.go +++ b/grpc_test.go @@ -5,11 +5,12 @@ import ( "net" "testing" - "github.com/micro/go-micro/v2/client" - "github.com/micro/go-micro/v2/errors" - "github.com/micro/go-micro/v2/registry" - "github.com/micro/go-micro/v2/registry/memory" - "github.com/micro/go-micro/v2/router" + "github.com/micro/go-micro/v3/client" + "github.com/micro/go-micro/v3/errors" + "github.com/micro/go-micro/v3/registry" + "github.com/micro/go-micro/v3/registry/memory" + "github.com/micro/go-micro/v3/router" + regRouter "github.com/micro/go-micro/v3/router/registry" pgrpc "google.golang.org/grpc" pb "google.golang.org/grpc/examples/helloworld/helloworld" ) @@ -57,7 +58,7 @@ func TestGRPCClient(t *testing.T) { }) // create router - rtr := router.NewRouter(router.Registry(r)) + rtr := regRouter.NewRouter(router.Registry(r)) // create client c := NewClient(client.Router(rtr)) diff --git a/message.go b/message.go index ddc8b92..cdcc3bd 100644 --- a/message.go +++ b/message.go @@ -1,7 +1,7 @@ package grpc import ( - "github.com/micro/go-micro/v2/client" + "github.com/micro/go-micro/v3/client" ) type grpcEvent struct { diff --git a/options.go b/options.go index 28222f8..220f758 100644 --- a/options.go +++ b/options.go @@ -5,7 +5,7 @@ import ( "context" "crypto/tls" - "github.com/micro/go-micro/v2/client" + "github.com/micro/go-micro/v3/client" "google.golang.org/grpc" "google.golang.org/grpc/encoding" ) diff --git a/request.go b/request.go index d755572..e957eb1 100644 --- a/request.go +++ b/request.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/micro/go-micro/v2/client" - "github.com/micro/go-micro/v2/codec" + "github.com/micro/go-micro/v3/client" + "github.com/micro/go-micro/v3/codec" ) type grpcRequest struct { diff --git a/response.go b/response.go index cd4d319..1a871c9 100644 --- a/response.go +++ b/response.go @@ -3,8 +3,8 @@ package grpc import ( "strings" - "github.com/micro/go-micro/v2/codec" - "github.com/micro/go-micro/v2/codec/bytes" + "github.com/micro/go-micro/v3/codec" + "github.com/micro/go-micro/v3/codec/bytes" "google.golang.org/grpc" "google.golang.org/grpc/encoding" ) diff --git a/stream.go b/stream.go index ae13bbc..5051718 100644 --- a/stream.go +++ b/stream.go @@ -5,7 +5,7 @@ import ( "io" "sync" - "github.com/micro/go-micro/v2/client" + "github.com/micro/go-micro/v3/client" "google.golang.org/grpc" )