From 73f577df6bb4bef0b4b01323e2395f026edaff48 Mon Sep 17 00:00:00 2001 From: binbin0325 Date: Fri, 21 Jul 2023 10:06:41 +0800 Subject: [PATCH] commit --- clients/nacos_client/nacos_client.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/clients/nacos_client/nacos_client.go b/clients/nacos_client/nacos_client.go index dae05db2..e7c24dae 100644 --- a/clients/nacos_client/nacos_client.go +++ b/clients/nacos_client/nacos_client.go @@ -25,7 +25,6 @@ import ( "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" - "github.com/nacos-group/nacos-sdk-go/v2/common/logger" ) type NacosClient struct { @@ -36,7 +35,7 @@ type NacosClient struct { serverConfigs []constant.ServerConfig } -//SetClientConfig is use to set nacos client Config +// SetClientConfig is use to set nacos client Config func (client *NacosClient) SetClientConfig(config constant.ClientConfig) (err error) { if config.TimeoutMs <= 0 { config.TimeoutMs = 10 * 1000 @@ -62,15 +61,13 @@ func (client *NacosClient) SetClientConfig(config constant.ClientConfig) (err er config.LogDir = file.GetCurrentPath() + string(os.PathSeparator) + "log" } - logger.Infof("logDir:<%s> cacheDir:<%s>", config.LogDir, config.CacheDir) - client.clientConfig = config client.clientConfigValid = true return } -//SetServerConfig is use to set nacos server config +// SetServerConfig is use to set nacos server config func (client *NacosClient) SetServerConfig(configs []constant.ServerConfig) (err error) { if len(configs) <= 0 { //it's may be use endpoint to get nacos server address @@ -95,7 +92,7 @@ func (client *NacosClient) SetServerConfig(configs []constant.ServerConfig) (err return } -//GetClientConfig use to get client config +// GetClientConfig use to get client config func (client *NacosClient) GetClientConfig() (config constant.ClientConfig, err error) { config = client.clientConfig if !client.clientConfigValid { @@ -104,7 +101,7 @@ func (client *NacosClient) GetClientConfig() (config constant.ClientConfig, err return } -//GetServerConfig use to get server config +// GetServerConfig use to get server config func (client *NacosClient) GetServerConfig() (configs []constant.ServerConfig, err error) { configs = client.serverConfigs if !client.serverConfigsValid { @@ -113,7 +110,7 @@ func (client *NacosClient) GetServerConfig() (configs []constant.ServerConfig, e return } -//SetHttpAgent use to set http agent +// SetHttpAgent use to set http agent func (client *NacosClient) SetHttpAgent(agent http_agent.IHttpAgent) (err error) { if agent == nil { err = errors.New("[client.SetHttpAgent] http agent can not be nil") @@ -123,7 +120,7 @@ func (client *NacosClient) SetHttpAgent(agent http_agent.IHttpAgent) (err error) return } -//GetHttpAgent use to get http agent +// GetHttpAgent use to get http agent func (client *NacosClient) GetHttpAgent() (agent http_agent.IHttpAgent, err error) { if client.agent == nil { err = errors.New("[client.GetHttpAgent] invalid http agent")