From 9eef0329a7fa3b9c52e27e998fe130022a31446d Mon Sep 17 00:00:00 2001 From: "binbin.zhang" Date: Thu, 10 Jun 2021 23:30:32 +0800 Subject: [PATCH] update mod v2 (#265) --- clients/cache/disk_cache.go | 8 +++---- clients/client_factory.go | 12 +++++----- clients/client_factory_test.go | 4 ++-- clients/config_client/config_client.go | 24 +++++++++---------- .../config_client/config_client_interface.go | 4 ++-- clients/config_client/config_client_test.go | 18 +++++++------- clients/config_client/config_proxy.go | 24 +++++++++---------- .../config_client/config_proxy_interface.go | 10 ++++---- clients/nacos_client/nacos_client.go | 6 ++--- .../nacos_client/nacos_client_interface.go | 4 ++-- .../naming_cache/service_info_holder.go | 8 +++---- .../naming_cache/subscribe_callback.go | 8 +++---- .../naming_cache/subscribe_callback_test.go | 6 ++--- clients/naming_client/naming_client.go | 18 +++++++------- .../naming_client/naming_client_interface.go | 4 ++-- clients/naming_client/naming_client_test.go | 10 ++++---- .../naming_grpc/connection_event_listener.go | 10 ++++---- .../naming_grpc/naming_grpc_proxy.go | 20 ++++++++-------- .../naming_client/naming_http/beat_reactor.go | 12 +++++----- .../naming_http/beat_reactor_test.go | 8 +++---- .../naming_http/naming_http_proxy.go | 12 +++++----- .../naming_http/push_receiver.go | 6 ++--- .../naming_client/naming_instance_chooser.go | 2 +- .../naming_proxy/naming_proxy_delegate.go | 16 ++++++------- .../naming_proxy/naming_proxy_interface.go | 2 +- clients/naming_client/service_info_updater.go | 10 ++++---- common/constant/client_config_options.go | 2 +- common/constant/client_config_options_test.go | 2 +- common/http_agent/http_agent.go | 6 ++--- common/http_agent/post.go | 2 +- common/logger/logger.go | 2 +- common/nacos_error/nacos_error.go | 2 +- common/nacos_server/nacos_server.go | 14 +++++------ common/nacos_server/nacos_server_test.go | 2 +- common/remote/rpc/connection.go | 4 ++-- common/remote/rpc/connection_test.go | 4 ++-- common/remote/rpc/grpc_client.go | 12 +++++----- common/remote/rpc/grpc_connection.go | 8 +++---- common/remote/rpc/rpc_client.go | 12 +++++----- .../remote/rpc/rpc_request/config_request.go | 2 +- .../remote/rpc/rpc_request/naming_request.go | 2 +- common/remote/rpc/rpc_request/rpc_request.go | 2 +- .../rpc/rpc_response/config_response.go | 2 +- .../rpc/rpc_response/naming_response.go | 2 +- .../remote/rpc/rpc_response/rpc_response.go | 4 ++-- common/remote/rpc/server_request_handler.go | 13 ++++------ common/security/security_proxy.go | 6 ++--- example/config/main.go | 6 ++--- example/service/main.go | 10 ++++---- example/service/service_client_example.go | 4 ++-- go.mod | 4 ++-- util/common.go | 6 ++--- util/object2param.go | 2 +- vo/client_param.go | 17 ++++++++++++- vo/service_param.go | 2 +- 55 files changed, 217 insertions(+), 205 deletions(-) diff --git a/clients/cache/disk_cache.go b/clients/cache/disk_cache.go index cec60ab3..329dc712 100644 --- a/clients/cache/disk_cache.go +++ b/clients/cache/disk_cache.go @@ -24,10 +24,10 @@ import ( "strconv" "github.com/go-errors/errors" - "github.com/nacos-group/nacos-sdk-go/common/file" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/common/file" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" ) func GetFileName(cacheKey string, cacheDir string) string { diff --git a/clients/client_factory.go b/clients/client_factory.go index 73f009d9..17eda6d1 100644 --- a/clients/client_factory.go +++ b/clients/client_factory.go @@ -19,13 +19,13 @@ package clients import ( "errors" - "github.com/nacos-group/nacos-sdk-go/clients/naming_client" + "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client" - "github.com/nacos-group/nacos-sdk-go/clients/config_client" - "github.com/nacos-group/nacos-sdk-go/clients/nacos_client" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/http_agent" - "github.com/nacos-group/nacos-sdk-go/vo" + "github.com/nacos-group/nacos-sdk-go/v2/clients/config_client" + "github.com/nacos-group/nacos-sdk-go/v2/clients/nacos_client" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/http_agent" + "github.com/nacos-group/nacos-sdk-go/v2/vo" ) // CreateConfigClient use to create config client diff --git a/clients/client_factory_test.go b/clients/client_factory_test.go index 72538f5a..2cc0a974 100644 --- a/clients/client_factory_test.go +++ b/clients/client_factory_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/vo" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/vo" "github.com/stretchr/testify/assert" ) diff --git a/clients/config_client/config_client.go b/clients/config_client/config_client.go index cc211256..627aafe3 100644 --- a/clients/config_client/config_client.go +++ b/clients/config_client/config_client.go @@ -25,17 +25,17 @@ import ( "time" "github.com/aliyun/alibaba-cloud-sdk-go/services/kms" - "github.com/nacos-group/nacos-sdk-go/clients/cache" - "github.com/nacos-group/nacos-sdk-go/clients/nacos_client" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/common/nacos_error" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_request" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_response" - "github.com/nacos-group/nacos-sdk-go/inner/uuid" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" - "github.com/nacos-group/nacos-sdk-go/vo" + "github.com/nacos-group/nacos-sdk-go/v2/clients/cache" + "github.com/nacos-group/nacos-sdk-go/v2/clients/nacos_client" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/common/nacos_error" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_request" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_response" + "github.com/nacos-group/nacos-sdk-go/v2/inner/uuid" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" + "github.com/nacos-group/nacos-sdk-go/v2/vo" ) const ( @@ -92,7 +92,7 @@ func NewConfigClient(nc nacos_client.INacosClient) (*ConfigClient, error) { return nil, err } - if initLogger(clientConfig); err != nil { + if err = initLogger(clientConfig); err != nil { return nil, err } config.configCacheDir = clientConfig.CacheDir + string(os.PathSeparator) + "config" diff --git a/clients/config_client/config_client_interface.go b/clients/config_client/config_client_interface.go index 3e28700f..c168f839 100644 --- a/clients/config_client/config_client_interface.go +++ b/clients/config_client/config_client_interface.go @@ -17,8 +17,8 @@ package config_client import ( - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/vo" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/vo" ) //go:generate mockgen -destination ../../mock/mock_config_client_interface.go -package mock -source=./config_client_interface.go diff --git a/clients/config_client/config_client_test.go b/clients/config_client/config_client_test.go index 80d50a6b..21174041 100644 --- a/clients/config_client/config_client_test.go +++ b/clients/config_client/config_client_test.go @@ -19,15 +19,15 @@ package config_client import ( "testing" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_request" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_response" - "github.com/nacos-group/nacos-sdk-go/model" - - "github.com/nacos-group/nacos-sdk-go/clients/nacos_client" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/http_agent" - "github.com/nacos-group/nacos-sdk-go/vo" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_request" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_response" + "github.com/nacos-group/nacos-sdk-go/v2/model" + + "github.com/nacos-group/nacos-sdk-go/v2/clients/nacos_client" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/http_agent" + "github.com/nacos-group/nacos-sdk-go/v2/vo" "github.com/stretchr/testify/assert" ) diff --git a/clients/config_client/config_proxy.go b/clients/config_client/config_proxy.go index 88043ee0..bc1e4c67 100644 --- a/clients/config_client/config_proxy.go +++ b/clients/config_client/config_proxy.go @@ -22,18 +22,18 @@ import ( "net/http" "strconv" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_request" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_response" - - "github.com/nacos-group/nacos-sdk-go/clients/cache" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/http_agent" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/common/nacos_server" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" - "github.com/nacos-group/nacos-sdk-go/vo" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_request" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_response" + + "github.com/nacos-group/nacos-sdk-go/v2/clients/cache" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/http_agent" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/common/nacos_server" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" + "github.com/nacos-group/nacos-sdk-go/v2/vo" ) type ConfigProxy struct { diff --git a/clients/config_client/config_proxy_interface.go b/clients/config_client/config_proxy_interface.go index f9696d4b..b241307b 100644 --- a/clients/config_client/config_proxy_interface.go +++ b/clients/config_client/config_proxy_interface.go @@ -1,11 +1,11 @@ package config_client import ( - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_request" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_response" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/vo" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_request" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_response" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/vo" ) type IConfigProxy interface { diff --git a/clients/nacos_client/nacos_client.go b/clients/nacos_client/nacos_client.go index e524805c..fe8774fe 100644 --- a/clients/nacos_client/nacos_client.go +++ b/clients/nacos_client/nacos_client.go @@ -22,9 +22,9 @@ import ( "os" "strconv" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/file" - "github.com/nacos-group/nacos-sdk-go/common/http_agent" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/file" + "github.com/nacos-group/nacos-sdk-go/v2/common/http_agent" ) type NacosClient struct { diff --git a/clients/nacos_client/nacos_client_interface.go b/clients/nacos_client/nacos_client_interface.go index fca7c616..d9c9b113 100644 --- a/clients/nacos_client/nacos_client_interface.go +++ b/clients/nacos_client/nacos_client_interface.go @@ -17,8 +17,8 @@ package nacos_client import ( - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/http_agent" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/http_agent" ) //go:generate mockgen -destination mock_nacos_client_interface.go -package nacos_client -source=./nacos_client_interface.go diff --git a/clients/naming_client/naming_cache/service_info_holder.go b/clients/naming_client/naming_cache/service_info_holder.go index 4c09b011..d10bb9bc 100644 --- a/clients/naming_client/naming_cache/service_info_holder.go +++ b/clients/naming_client/naming_cache/service_info_holder.go @@ -20,10 +20,10 @@ import ( "os" "reflect" - "github.com/nacos-group/nacos-sdk-go/clients/cache" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/clients/cache" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" ) type ServiceInfoHolder struct { diff --git a/clients/naming_client/naming_cache/subscribe_callback.go b/clients/naming_client/naming_cache/subscribe_callback.go index cca6c842..94bc8b12 100644 --- a/clients/naming_client/naming_cache/subscribe_callback.go +++ b/clients/naming_client/naming_cache/subscribe_callback.go @@ -20,10 +20,10 @@ import ( "errors" "sync" - "github.com/nacos-group/nacos-sdk-go/clients/cache" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/clients/cache" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" ) type SubscribeCallback struct { diff --git a/clients/naming_client/naming_cache/subscribe_callback_test.go b/clients/naming_client/naming_cache/subscribe_callback_test.go index 35f9b687..03dca2b6 100644 --- a/clients/naming_client/naming_cache/subscribe_callback_test.go +++ b/clients/naming_client/naming_cache/subscribe_callback_test.go @@ -23,9 +23,9 @@ import ( "testing" "time" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" - "github.com/nacos-group/nacos-sdk-go/vo" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" + "github.com/nacos-group/nacos-sdk-go/v2/vo" "github.com/stretchr/testify/assert" ) diff --git a/clients/naming_client/naming_client.go b/clients/naming_client/naming_client.go index 5faa91b2..ae8e688d 100644 --- a/clients/naming_client/naming_client.go +++ b/clients/naming_client/naming_client.go @@ -22,14 +22,14 @@ import ( "strings" "time" - "github.com/nacos-group/nacos-sdk-go/clients/nacos_client" - "github.com/nacos-group/nacos-sdk-go/clients/naming_client/naming_cache" - "github.com/nacos-group/nacos-sdk-go/clients/naming_client/naming_proxy" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" - "github.com/nacos-group/nacos-sdk-go/vo" + "github.com/nacos-group/nacos-sdk-go/v2/clients/nacos_client" + "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client/naming_cache" + "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client/naming_proxy" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" + "github.com/nacos-group/nacos-sdk-go/v2/vo" "github.com/pkg/errors" ) @@ -57,7 +57,7 @@ func NewNamingClient(nc nacos_client.INacosClient) (*NamingClient, error) { return naming, err } - if initLogger(clientConfig) != nil { + if err = initLogger(clientConfig); err != nil { return naming, err } if clientConfig.NamespaceId == "" { diff --git a/clients/naming_client/naming_client_interface.go b/clients/naming_client/naming_client_interface.go index 45ebf12c..01cc1700 100644 --- a/clients/naming_client/naming_client_interface.go +++ b/clients/naming_client/naming_client_interface.go @@ -16,8 +16,8 @@ package naming_client import ( - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/vo" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/vo" ) //go:generate mockgen -destination ../../mock/mock_service_client_interface.go -package mock -source=./service_client_interface.go diff --git a/clients/naming_client/naming_client_test.go b/clients/naming_client/naming_client_test.go index 07e38463..539215c9 100644 --- a/clients/naming_client/naming_client_test.go +++ b/clients/naming_client/naming_client_test.go @@ -19,12 +19,12 @@ package naming_client import ( "testing" - "github.com/nacos-group/nacos-sdk-go/common/http_agent" + "github.com/nacos-group/nacos-sdk-go/v2/common/http_agent" - "github.com/nacos-group/nacos-sdk-go/clients/nacos_client" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/vo" + "github.com/nacos-group/nacos-sdk-go/v2/clients/nacos_client" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/vo" "github.com/stretchr/testify/assert" ) diff --git a/clients/naming_client/naming_grpc/connection_event_listener.go b/clients/naming_client/naming_grpc/connection_event_listener.go index ab855993..3075fc81 100644 --- a/clients/naming_client/naming_grpc/connection_event_listener.go +++ b/clients/naming_client/naming_grpc/connection_event_listener.go @@ -20,11 +20,11 @@ import ( "reflect" "strings" - "github.com/nacos-group/nacos-sdk-go/clients/cache" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/clients/cache" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" ) type ConnectionEventListener struct { diff --git a/clients/naming_client/naming_grpc/naming_grpc_proxy.go b/clients/naming_client/naming_grpc/naming_grpc_proxy.go index dd0877b3..01a42fb5 100644 --- a/clients/naming_client/naming_grpc/naming_grpc_proxy.go +++ b/clients/naming_client/naming_grpc/naming_grpc_proxy.go @@ -17,16 +17,16 @@ package naming_grpc import ( - "github.com/nacos-group/nacos-sdk-go/clients/naming_client/naming_cache" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/common/nacos_server" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_request" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_response" - "github.com/nacos-group/nacos-sdk-go/inner/uuid" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client/naming_cache" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/common/nacos_server" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_request" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_response" + "github.com/nacos-group/nacos-sdk-go/v2/inner/uuid" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" ) type NamingGrpcProxy struct { diff --git a/clients/naming_client/naming_http/beat_reactor.go b/clients/naming_client/naming_http/beat_reactor.go index 451fd3f7..b3dac156 100644 --- a/clients/naming_client/naming_http/beat_reactor.go +++ b/clients/naming_client/naming_http/beat_reactor.go @@ -25,12 +25,12 @@ import ( "time" "github.com/buger/jsonparser" - "github.com/nacos-group/nacos-sdk-go/clients/cache" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/common/nacos_server" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/clients/cache" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/common/nacos_server" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" nsema "github.com/toolkits/concurrent/semaphore" ) diff --git a/clients/naming_client/naming_http/beat_reactor_test.go b/clients/naming_client/naming_http/beat_reactor_test.go index c49ec86e..6f78477b 100644 --- a/clients/naming_client/naming_http/beat_reactor_test.go +++ b/clients/naming_client/naming_http/beat_reactor_test.go @@ -19,10 +19,10 @@ package naming_http import ( "testing" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/nacos_server" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/nacos_server" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" "github.com/stretchr/testify/assert" ) diff --git a/clients/naming_client/naming_http/naming_http_proxy.go b/clients/naming_client/naming_http/naming_http_proxy.go index 10602219..63b34568 100644 --- a/clients/naming_client/naming_http/naming_http_proxy.go +++ b/clients/naming_client/naming_http/naming_http_proxy.go @@ -24,12 +24,12 @@ import ( "time" "github.com/buger/jsonparser" - "github.com/nacos-group/nacos-sdk-go/clients/naming_client/naming_cache" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/common/nacos_server" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client/naming_cache" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/common/nacos_server" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" ) type NamingHttpProxy struct { diff --git a/clients/naming_client/naming_http/push_receiver.go b/clients/naming_client/naming_http/push_receiver.go index 02a029c7..3b801b65 100644 --- a/clients/naming_client/naming_http/push_receiver.go +++ b/clients/naming_client/naming_http/push_receiver.go @@ -26,9 +26,9 @@ import ( "strconv" "time" - "github.com/nacos-group/nacos-sdk-go/clients/naming_client/naming_cache" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client/naming_cache" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/util" ) type PushReceiver struct { diff --git a/clients/naming_client/naming_instance_chooser.go b/clients/naming_client/naming_instance_chooser.go index 230330fc..5750cdb2 100644 --- a/clients/naming_client/naming_instance_chooser.go +++ b/clients/naming_client/naming_instance_chooser.go @@ -20,7 +20,7 @@ import ( "math/rand" "sort" - "github.com/nacos-group/nacos-sdk-go/model" + "github.com/nacos-group/nacos-sdk-go/v2/model" ) type Chooser struct { diff --git a/clients/naming_client/naming_proxy/naming_proxy_delegate.go b/clients/naming_client/naming_proxy/naming_proxy_delegate.go index f186e540..e3bbefd0 100644 --- a/clients/naming_client/naming_proxy/naming_proxy_delegate.go +++ b/clients/naming_client/naming_proxy/naming_proxy_delegate.go @@ -17,14 +17,14 @@ package naming_proxy import ( - "github.com/nacos-group/nacos-sdk-go/clients/naming_client/naming_cache" - "github.com/nacos-group/nacos-sdk-go/clients/naming_client/naming_grpc" - "github.com/nacos-group/nacos-sdk-go/clients/naming_client/naming_http" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/http_agent" - "github.com/nacos-group/nacos-sdk-go/common/nacos_server" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client/naming_cache" + "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client/naming_grpc" + "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client/naming_http" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/http_agent" + "github.com/nacos-group/nacos-sdk-go/v2/common/nacos_server" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" ) type NamingProxyDelegate struct { diff --git a/clients/naming_client/naming_proxy/naming_proxy_interface.go b/clients/naming_client/naming_proxy/naming_proxy_interface.go index f44fa553..793d2172 100644 --- a/clients/naming_client/naming_proxy/naming_proxy_interface.go +++ b/clients/naming_client/naming_proxy/naming_proxy_interface.go @@ -17,7 +17,7 @@ package naming_proxy import ( - "github.com/nacos-group/nacos-sdk-go/model" + "github.com/nacos-group/nacos-sdk-go/v2/model" ) type INamingProxy interface { diff --git a/clients/naming_client/service_info_updater.go b/clients/naming_client/service_info_updater.go index 13e3155d..22e3c213 100644 --- a/clients/naming_client/service_info_updater.go +++ b/clients/naming_client/service_info_updater.go @@ -19,11 +19,11 @@ package naming_client import ( "time" - "github.com/nacos-group/nacos-sdk-go/clients/naming_client/naming_cache" - "github.com/nacos-group/nacos-sdk-go/clients/naming_client/naming_proxy" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client/naming_cache" + "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client/naming_proxy" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" ) type ServiceInfoUpdater struct { diff --git a/common/constant/client_config_options.go b/common/constant/client_config_options.go index fbf8e7c9..5dd1400b 100644 --- a/common/constant/client_config_options.go +++ b/common/constant/client_config_options.go @@ -19,7 +19,7 @@ package constant import ( "os" - "github.com/nacos-group/nacos-sdk-go/common/file" + "github.com/nacos-group/nacos-sdk-go/v2/common/file" ) func NewClientConfig(opts ...ClientOption) *ClientConfig { diff --git a/common/constant/client_config_options_test.go b/common/constant/client_config_options_test.go index 0005789b..b83da3c4 100644 --- a/common/constant/client_config_options_test.go +++ b/common/constant/client_config_options_test.go @@ -20,7 +20,7 @@ import ( "os" "testing" - "github.com/nacos-group/nacos-sdk-go/common/file" + "github.com/nacos-group/nacos-sdk-go/v2/common/file" "github.com/stretchr/testify/assert" ) diff --git a/common/http_agent/http_agent.go b/common/http_agent/http_agent.go index 41937db1..20a0c52e 100644 --- a/common/http_agent/http_agent.go +++ b/common/http_agent/http_agent.go @@ -20,11 +20,11 @@ import ( "io/ioutil" "net/http" - "github.com/nacos-group/nacos-sdk-go/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" "github.com/go-errors/errors" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/util" ) type HttpAgent struct { diff --git a/common/http_agent/post.go b/common/http_agent/post.go index 13fffc1c..8a1ece4b 100644 --- a/common/http_agent/post.go +++ b/common/http_agent/post.go @@ -20,7 +20,7 @@ import ( "strings" "time" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/util" ) func post(path string, header http.Header, timeoutMs uint64, params map[string]string) (response *http.Response, err error) { diff --git a/common/logger/logger.go b/common/logger/logger.go index 3df74622..bffa08e4 100644 --- a/common/logger/logger.go +++ b/common/logger/logger.go @@ -24,7 +24,7 @@ import ( "time" rotatelogs "github.com/lestrrat/go-file-rotatelogs" - "github.com/nacos-group/nacos-sdk-go/common/file" + "github.com/nacos-group/nacos-sdk-go/v2/common/file" "go.uber.org/zap" "go.uber.org/zap/zapcore" ) diff --git a/common/nacos_error/nacos_error.go b/common/nacos_error/nacos_error.go index d09cae62..1b654a20 100644 --- a/common/nacos_error/nacos_error.go +++ b/common/nacos_error/nacos_error.go @@ -19,7 +19,7 @@ package nacos_error import ( "fmt" - "github.com/nacos-group/nacos-sdk-go/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" ) type NacosError struct { diff --git a/common/nacos_server/nacos_server.go b/common/nacos_server/nacos_server.go index 4ce3bbe2..062b73dc 100644 --- a/common/nacos_server/nacos_server.go +++ b/common/nacos_server/nacos_server.go @@ -32,13 +32,13 @@ import ( "sync/atomic" "time" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/http_agent" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/common/nacos_error" - "github.com/nacos-group/nacos-sdk-go/common/security" - "github.com/nacos-group/nacos-sdk-go/inner/uuid" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/http_agent" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/common/nacos_error" + "github.com/nacos-group/nacos-sdk-go/v2/common/security" + "github.com/nacos-group/nacos-sdk-go/v2/inner/uuid" + "github.com/nacos-group/nacos-sdk-go/v2/util" ) type NacosServer struct { diff --git a/common/nacos_server/nacos_server_test.go b/common/nacos_server/nacos_server_test.go index 010d6e37..6ca6fc75 100644 --- a/common/nacos_server/nacos_server_test.go +++ b/common/nacos_server/nacos_server_test.go @@ -19,7 +19,7 @@ package nacos_server import ( "testing" - "github.com/nacos-group/nacos-sdk-go/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" "github.com/stretchr/testify/assert" ) diff --git a/common/remote/rpc/connection.go b/common/remote/rpc/connection.go index ca0a2755..bb6014c6 100644 --- a/common/remote/rpc/connection.go +++ b/common/remote/rpc/connection.go @@ -17,8 +17,8 @@ package rpc import ( - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_request" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_response" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_request" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_response" "google.golang.org/grpc" ) diff --git a/common/remote/rpc/connection_test.go b/common/remote/rpc/connection_test.go index 02e9ecb2..bd830a8c 100644 --- a/common/remote/rpc/connection_test.go +++ b/common/remote/rpc/connection_test.go @@ -1,8 +1,8 @@ package rpc import ( - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_request" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_response" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_request" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_response" ) type MockConnection struct { diff --git a/common/remote/rpc/grpc_client.go b/common/remote/rpc/grpc_client.go index 31cf554e..f5b10539 100644 --- a/common/remote/rpc/grpc_client.go +++ b/common/remote/rpc/grpc_client.go @@ -26,13 +26,13 @@ import ( "sync/atomic" "time" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_request" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_response" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_request" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_response" - nacos_grpc_service "github.com/nacos-group/nacos-sdk-go/api/grpc" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/common/nacos_server" + nacos_grpc_service "github.com/nacos-group/nacos-sdk-go/v2/api/grpc" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/common/nacos_server" "google.golang.org/grpc" "google.golang.org/grpc/keepalive" ) diff --git a/common/remote/rpc/grpc_connection.go b/common/remote/rpc/grpc_connection.go index ee15160a..aa408aa8 100644 --- a/common/remote/rpc/grpc_connection.go +++ b/common/remote/rpc/grpc_connection.go @@ -23,13 +23,13 @@ import ( "fmt" "time" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_request" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_response" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_request" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_response" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/util" "github.com/golang/protobuf/ptypes/any" - nacos_grpc_service "github.com/nacos-group/nacos-sdk-go/api/grpc" + nacos_grpc_service "github.com/nacos-group/nacos-sdk-go/v2/api/grpc" "google.golang.org/grpc" ) diff --git a/common/remote/rpc/rpc_client.go b/common/remote/rpc/rpc_client.go index baa3350f..988868e7 100644 --- a/common/remote/rpc/rpc_client.go +++ b/common/remote/rpc/rpc_client.go @@ -27,12 +27,12 @@ import ( "syscall" "time" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/common/nacos_server" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_request" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_response" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/common/nacos_server" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_request" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_response" + "github.com/nacos-group/nacos-sdk-go/v2/util" ) type ConnectionType uint32 diff --git a/common/remote/rpc/rpc_request/config_request.go b/common/remote/rpc/rpc_request/config_request.go index e2947e30..d87b6db5 100644 --- a/common/remote/rpc/rpc_request/config_request.go +++ b/common/remote/rpc/rpc_request/config_request.go @@ -16,7 +16,7 @@ package rpc_request -import "github.com/nacos-group/nacos-sdk-go/model" +import "github.com/nacos-group/nacos-sdk-go/v2/model" type ConfigRequest struct { *Request diff --git a/common/remote/rpc/rpc_request/naming_request.go b/common/remote/rpc/rpc_request/naming_request.go index 820bf3f8..1aed046a 100644 --- a/common/remote/rpc/rpc_request/naming_request.go +++ b/common/remote/rpc/rpc_request/naming_request.go @@ -17,7 +17,7 @@ package rpc_request import ( - "github.com/nacos-group/nacos-sdk-go/model" + "github.com/nacos-group/nacos-sdk-go/v2/model" ) type NamingRequest struct { diff --git a/common/remote/rpc/rpc_request/rpc_request.go b/common/remote/rpc/rpc_request/rpc_request.go index 53489d6a..149309a4 100644 --- a/common/remote/rpc/rpc_request/rpc_request.go +++ b/common/remote/rpc/rpc_request/rpc_request.go @@ -16,7 +16,7 @@ package rpc_request -import "github.com/nacos-group/nacos-sdk-go/util" +import "github.com/nacos-group/nacos-sdk-go/v2/util" type Request struct { Headers map[string]string `json:"-"` diff --git a/common/remote/rpc/rpc_response/config_response.go b/common/remote/rpc/rpc_response/config_response.go index f2d84d86..de060bfa 100644 --- a/common/remote/rpc/rpc_response/config_response.go +++ b/common/remote/rpc/rpc_response/config_response.go @@ -16,7 +16,7 @@ package rpc_response -import "github.com/nacos-group/nacos-sdk-go/model" +import "github.com/nacos-group/nacos-sdk-go/v2/model" type ConfigChangeBatchListenResponse struct { *Response diff --git a/common/remote/rpc/rpc_response/naming_response.go b/common/remote/rpc/rpc_response/naming_response.go index 5269228a..8d6fa2bb 100644 --- a/common/remote/rpc/rpc_response/naming_response.go +++ b/common/remote/rpc/rpc_response/naming_response.go @@ -17,7 +17,7 @@ package rpc_response import ( - "github.com/nacos-group/nacos-sdk-go/model" + "github.com/nacos-group/nacos-sdk-go/v2/model" ) type ConnectResetResponse struct { diff --git a/common/remote/rpc/rpc_response/rpc_response.go b/common/remote/rpc/rpc_response/rpc_response.go index d44a5636..3070468e 100644 --- a/common/remote/rpc/rpc_response/rpc_response.go +++ b/common/remote/rpc/rpc_response/rpc_response.go @@ -17,8 +17,8 @@ package rpc_response import ( - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/util" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/util" ) var ClientResponseMapping map[string]func() IResponse diff --git a/common/remote/rpc/server_request_handler.go b/common/remote/rpc/server_request_handler.go index 1b791da4..aa749ff6 100644 --- a/common/remote/rpc/server_request_handler.go +++ b/common/remote/rpc/server_request_handler.go @@ -19,14 +19,11 @@ package rpc import ( "strconv" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_request" - "github.com/nacos-group/nacos-sdk-go/common/remote/rpc/rpc_response" - - "github.com/nacos-group/nacos-sdk-go/clients/naming_client/naming_cache" - - "github.com/nacos-group/nacos-sdk-go/common/constant" - - "github.com/nacos-group/nacos-sdk-go/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client/naming_cache" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_request" + "github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_response" ) //ServerRequestHandler, to process the request from server side. diff --git a/common/security/security_proxy.go b/common/security/security_proxy.go index 6d2dd5e8..70b2bb94 100644 --- a/common/security/security_proxy.go +++ b/common/security/security_proxy.go @@ -26,9 +26,9 @@ import ( "sync/atomic" "time" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/http_agent" - "github.com/nacos-group/nacos-sdk-go/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/http_agent" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" ) type AuthClient struct { diff --git a/example/config/main.go b/example/config/main.go index b4b418c0..2619571d 100644 --- a/example/config/main.go +++ b/example/config/main.go @@ -20,9 +20,9 @@ import ( "fmt" "time" - "github.com/nacos-group/nacos-sdk-go/clients" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/vo" + "github.com/nacos-group/nacos-sdk-go/v2/clients" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/vo" ) func main() { diff --git a/example/service/main.go b/example/service/main.go index 2ca7da7a..bb6a5d65 100644 --- a/example/service/main.go +++ b/example/service/main.go @@ -20,11 +20,11 @@ import ( "fmt" "time" - "github.com/nacos-group/nacos-sdk-go/clients" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/model" - "github.com/nacos-group/nacos-sdk-go/util" - "github.com/nacos-group/nacos-sdk-go/vo" + "github.com/nacos-group/nacos-sdk-go/v2/clients" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/model" + "github.com/nacos-group/nacos-sdk-go/v2/util" + "github.com/nacos-group/nacos-sdk-go/v2/vo" ) func main() { diff --git a/example/service/service_client_example.go b/example/service/service_client_example.go index 27a00647..c6619756 100644 --- a/example/service/service_client_example.go +++ b/example/service/service_client_example.go @@ -19,9 +19,9 @@ package main import ( "fmt" - "github.com/nacos-group/nacos-sdk-go/clients/naming_client" + "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client" - "github.com/nacos-group/nacos-sdk-go/vo" + "github.com/nacos-group/nacos-sdk-go/v2/vo" ) func ExampleServiceClient_RegisterServiceInstance(client naming_client.INamingClient, param vo.RegisterInstanceParam) { diff --git a/go.mod b/go.mod index bac0ab3b..450a33c6 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ -module github.com/nacos-group/nacos-sdk-go +module github.com/nacos-group/nacos-sdk-go/v2 -go 1.12 +go 1.14 require ( github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 diff --git a/util/common.go b/util/common.go index 5d31e3e1..9287cf3d 100644 --- a/util/common.go +++ b/util/common.go @@ -23,9 +23,9 @@ import ( "strconv" "time" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/common/logger" - "github.com/nacos-group/nacos-sdk-go/model" + "github.com/nacos-group/nacos-sdk-go/v2/common/constant" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/model" ) func CurrentMillis() int64 { diff --git a/util/object2param.go b/util/object2param.go index e02dd3d6..de798308 100644 --- a/util/object2param.go +++ b/util/object2param.go @@ -22,7 +22,7 @@ import ( "strconv" "strings" - "github.com/nacos-group/nacos-sdk-go/common/logger" + "github.com/nacos-group/nacos-sdk-go/v2/common/logger" ) func TransformObject2Param(object interface{}) (params map[string]string) { diff --git a/vo/client_param.go b/vo/client_param.go index cbe27d75..f48a5b75 100644 --- a/vo/client_param.go +++ b/vo/client_param.go @@ -1,6 +1,21 @@ +/* + * Copyright 1999-2020 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package vo -import "github.com/nacos-group/nacos-sdk-go/common/constant" +import "github.com/nacos-group/nacos-sdk-go/v2/common/constant" type NacosClientParam struct { ClientConfig *constant.ClientConfig // optional diff --git a/vo/service_param.go b/vo/service_param.go index d40f89f2..698089bc 100644 --- a/vo/service_param.go +++ b/vo/service_param.go @@ -16,7 +16,7 @@ package vo -import "github.com/nacos-group/nacos-sdk-go/model" +import "github.com/nacos-group/nacos-sdk-go/v2/model" type RegisterInstanceParam struct { Ip string `param:"ip"` //required