From ca5acba0c6e1cadc5b666a5f8780691484fc83f8 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Fri, 21 Jun 2019 15:13:54 +0100 Subject: [PATCH] Move selector to client/selector --- api/handler/api/api.go | 2 +- api/handler/api/util.go | 2 +- api/handler/http/http.go | 2 +- api/handler/rpc/rpc.go | 2 +- api/handler/web/web.go | 2 +- client/grpc/grpc.go | 2 +- client/grpc/grpc_test.go | 2 +- client/options.go | 2 +- client/rpc_client.go | 2 +- client/rpc_client_test.go | 2 +- {selector => client/selector}/common_test.go | 0 {selector => client/selector}/default.go | 0 {selector => client/selector}/default_test.go | 0 {selector => client/selector}/dns/dns.go | 2 +- {selector => client/selector}/filter.go | 0 {selector => client/selector}/filter_test.go | 0 {selector => client/selector}/options.go | 0 {selector => client/selector}/registry/options.go | 2 +- {selector => client/selector}/registry/registry.go | 2 +- {selector => client/selector}/selector.go | 0 {selector => client/selector}/static/static.go | 2 +- {selector => client/selector}/strategy.go | 0 {selector => client/selector}/strategy_test.go | 0 config/cmd/cmd.go | 6 +++--- config/cmd/options.go | 2 +- options.go | 2 +- util/http/http.go | 2 +- util/http/roundtripper.go | 2 +- 28 files changed, 21 insertions(+), 21 deletions(-) rename {selector => client/selector}/common_test.go (100%) rename {selector => client/selector}/default.go (100%) rename {selector => client/selector}/default_test.go (100%) rename {selector => client/selector}/dns/dns.go (98%) rename {selector => client/selector}/filter.go (100%) rename {selector => client/selector}/filter_test.go (100%) rename {selector => client/selector}/options.go (100%) rename {selector => client/selector}/registry/options.go (86%) rename {selector => client/selector}/registry/registry.go (84%) rename {selector => client/selector}/selector.go (100%) rename {selector => client/selector}/static/static.go (96%) rename {selector => client/selector}/strategy.go (100%) rename {selector => client/selector}/strategy_test.go (100%) diff --git a/api/handler/api/api.go b/api/handler/api/api.go index 20fa421d..366a9d87 100644 --- a/api/handler/api/api.go +++ b/api/handler/api/api.go @@ -9,7 +9,7 @@ import ( api "github.com/micro/go-micro/api/proto" "github.com/micro/go-micro/client" "github.com/micro/go-micro/errors" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" "github.com/micro/go-micro/util/ctx" ) diff --git a/api/handler/api/util.go b/api/handler/api/util.go index 123ad3f8..2ea1655e 100644 --- a/api/handler/api/util.go +++ b/api/handler/api/util.go @@ -10,7 +10,7 @@ import ( api "github.com/micro/go-micro/api/proto" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" ) func requestToProto(r *http.Request) (*api.Request, error) { diff --git a/api/handler/http/http.go b/api/handler/http/http.go index cbcd2992..b9380ce3 100644 --- a/api/handler/http/http.go +++ b/api/handler/http/http.go @@ -10,7 +10,7 @@ import ( "github.com/micro/go-micro/api" "github.com/micro/go-micro/api/handler" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" ) const ( diff --git a/api/handler/rpc/rpc.go b/api/handler/rpc/rpc.go index 28c67245..6ff79396 100644 --- a/api/handler/rpc/rpc.go +++ b/api/handler/rpc/rpc.go @@ -19,7 +19,7 @@ import ( "github.com/micro/go-micro/codec/protorpc" "github.com/micro/go-micro/errors" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" "github.com/micro/go-micro/util/ctx" ) diff --git a/api/handler/web/web.go b/api/handler/web/web.go index 2a6ba18f..415dd694 100644 --- a/api/handler/web/web.go +++ b/api/handler/web/web.go @@ -13,7 +13,7 @@ import ( "github.com/micro/go-micro/api" "github.com/micro/go-micro/api/handler" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" ) const ( diff --git a/client/grpc/grpc.go b/client/grpc/grpc.go index ac1dc82e..5c9ef01e 100644 --- a/client/grpc/grpc.go +++ b/client/grpc/grpc.go @@ -16,7 +16,7 @@ import ( "github.com/micro/go-micro/errors" "github.com/micro/go-micro/metadata" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" "github.com/micro/go-micro/transport" "google.golang.org/grpc" diff --git a/client/grpc/grpc_test.go b/client/grpc/grpc_test.go index 074d8931..85ba8ea2 100644 --- a/client/grpc/grpc_test.go +++ b/client/grpc/grpc_test.go @@ -10,7 +10,7 @@ import ( "github.com/micro/go-micro/client" "github.com/micro/go-micro/registry" "github.com/micro/go-micro/registry/memory" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" pgrpc "google.golang.org/grpc" pb "google.golang.org/grpc/examples/helloworld/helloworld" ) diff --git a/client/options.go b/client/options.go index 30a6386c..35cbe704 100644 --- a/client/options.go +++ b/client/options.go @@ -7,7 +7,7 @@ import ( "github.com/micro/go-micro/broker" "github.com/micro/go-micro/codec" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" "github.com/micro/go-micro/transport" ) diff --git a/client/rpc_client.go b/client/rpc_client.go index d22e7e42..4f05e1ce 100644 --- a/client/rpc_client.go +++ b/client/rpc_client.go @@ -17,7 +17,7 @@ import ( "github.com/micro/go-micro/errors" "github.com/micro/go-micro/metadata" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" "github.com/micro/go-micro/transport" ) diff --git a/client/rpc_client_test.go b/client/rpc_client_test.go index 219580cd..6af32598 100644 --- a/client/rpc_client_test.go +++ b/client/rpc_client_test.go @@ -8,7 +8,7 @@ import ( "github.com/micro/go-micro/errors" "github.com/micro/go-micro/registry" "github.com/micro/go-micro/registry/memory" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" ) func newTestRegistry() registry.Registry { diff --git a/selector/common_test.go b/client/selector/common_test.go similarity index 100% rename from selector/common_test.go rename to client/selector/common_test.go diff --git a/selector/default.go b/client/selector/default.go similarity index 100% rename from selector/default.go rename to client/selector/default.go diff --git a/selector/default_test.go b/client/selector/default_test.go similarity index 100% rename from selector/default_test.go rename to client/selector/default_test.go diff --git a/selector/dns/dns.go b/client/selector/dns/dns.go similarity index 98% rename from selector/dns/dns.go rename to client/selector/dns/dns.go index d3882ac1..1651a9d2 100644 --- a/selector/dns/dns.go +++ b/client/selector/dns/dns.go @@ -6,7 +6,7 @@ import ( "strconv" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" ) type dnsSelector struct { diff --git a/selector/filter.go b/client/selector/filter.go similarity index 100% rename from selector/filter.go rename to client/selector/filter.go diff --git a/selector/filter_test.go b/client/selector/filter_test.go similarity index 100% rename from selector/filter_test.go rename to client/selector/filter_test.go diff --git a/selector/options.go b/client/selector/options.go similarity index 100% rename from selector/options.go rename to client/selector/options.go diff --git a/selector/registry/options.go b/client/selector/registry/options.go similarity index 86% rename from selector/registry/options.go rename to client/selector/registry/options.go index 90aaf802..007c5023 100644 --- a/selector/registry/options.go +++ b/client/selector/registry/options.go @@ -4,7 +4,7 @@ import ( "context" "time" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" ) // Set the registry cache ttl diff --git a/selector/registry/registry.go b/client/selector/registry/registry.go similarity index 84% rename from selector/registry/registry.go rename to client/selector/registry/registry.go index b6d8600d..fe8373a7 100644 --- a/selector/registry/registry.go +++ b/client/selector/registry/registry.go @@ -2,7 +2,7 @@ package registry import ( - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" ) // NewSelector returns a new registry selector diff --git a/selector/selector.go b/client/selector/selector.go similarity index 100% rename from selector/selector.go rename to client/selector/selector.go diff --git a/selector/static/static.go b/client/selector/static/static.go similarity index 96% rename from selector/static/static.go rename to client/selector/static/static.go index 11c2c9cf..3ee79a96 100644 --- a/selector/static/static.go +++ b/client/selector/static/static.go @@ -6,7 +6,7 @@ import ( "strconv" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" ) // staticSelector is a static selector diff --git a/selector/strategy.go b/client/selector/strategy.go similarity index 100% rename from selector/strategy.go rename to client/selector/strategy.go diff --git a/selector/strategy_test.go b/client/selector/strategy_test.go similarity index 100% rename from selector/strategy_test.go rename to client/selector/strategy_test.go diff --git a/config/cmd/cmd.go b/config/cmd/cmd.go index 37616312..2e7e2a6e 100644 --- a/config/cmd/cmd.go +++ b/config/cmd/cmd.go @@ -32,9 +32,9 @@ import ( rmem "github.com/micro/go-micro/registry/memory" // selectors - "github.com/micro/go-micro/selector" - "github.com/micro/go-micro/selector/dns" - "github.com/micro/go-micro/selector/static" + "github.com/micro/go-micro/client/selector" + "github.com/micro/go-micro/client/selector/dns" + "github.com/micro/go-micro/client/selector/static" // transports "github.com/micro/go-micro/transport" diff --git a/config/cmd/options.go b/config/cmd/options.go index 1dcd4755..a078375a 100644 --- a/config/cmd/options.go +++ b/config/cmd/options.go @@ -6,7 +6,7 @@ import ( "github.com/micro/go-micro/broker" "github.com/micro/go-micro/client" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" "github.com/micro/go-micro/server" "github.com/micro/go-micro/transport" ) diff --git a/options.go b/options.go index b1eca164..41b782b5 100644 --- a/options.go +++ b/options.go @@ -9,7 +9,7 @@ import ( "github.com/micro/go-micro/client" "github.com/micro/go-micro/config/cmd" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" "github.com/micro/go-micro/server" "github.com/micro/go-micro/transport" ) diff --git a/util/http/http.go b/util/http/http.go index 06bff69f..aec84207 100644 --- a/util/http/http.go +++ b/util/http/http.go @@ -4,7 +4,7 @@ import ( "net/http" "github.com/micro/go-micro/registry" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" ) func NewRoundTripper(opts ...Option) http.RoundTripper { diff --git a/util/http/roundtripper.go b/util/http/roundtripper.go index f90ef34f..af2299be 100644 --- a/util/http/roundtripper.go +++ b/util/http/roundtripper.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "github.com/micro/go-micro/selector" + "github.com/micro/go-micro/client/selector" ) type roundTripper struct {