mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-05 21:02:11 +08:00
refactor: unified naming for module startup functions.
This commit is contained in:
parent
8da7c837bd
commit
7f97a87554
@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user