|
|
@ -15,7 +15,6 @@
|
|
|
|
package zookeeper
|
|
|
|
package zookeeper
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
@ -23,7 +22,6 @@ import (
|
|
|
|
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
|
|
|
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
|
|
|
"github.com/openimsdk/tools/discoveryregistry"
|
|
|
|
"github.com/openimsdk/tools/discoveryregistry"
|
|
|
|
openkeeper "github.com/openimsdk/tools/discoveryregistry/zookeeper"
|
|
|
|
openkeeper "github.com/openimsdk/tools/discoveryregistry/zookeeper"
|
|
|
|
"github.com/openimsdk/tools/errs"
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// NewZookeeperDiscoveryRegister creates a new instance of ZookeeperDR for Zookeeper service discovery and registration.
|
|
|
|
// NewZookeeperDiscoveryRegister creates a new instance of ZookeeperDR for Zookeeper service discovery and registration.
|
|
|
@ -43,13 +41,7 @@ func NewZookeeperDiscoveryRegister(zkConf *config.Zookeeper) (discoveryregistry.
|
|
|
|
// openkeeper.WithLogger(log.NewZkLogger()),
|
|
|
|
// openkeeper.WithLogger(log.NewZkLogger()),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
uriFormat := "address:%s, username:%s, password:%s, schema:%s."
|
|
|
|
return nil, err
|
|
|
|
errInfo := fmt.Sprintf(uriFormat,
|
|
|
|
|
|
|
|
zkConf.ZkAddr,
|
|
|
|
|
|
|
|
zkConf.Username,
|
|
|
|
|
|
|
|
zkConf.Password,
|
|
|
|
|
|
|
|
zkConf.Schema)
|
|
|
|
|
|
|
|
return nil, errs.WrapMsg(err, errInfo)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return zk, nil
|
|
|
|
return zk, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|