This commit is contained in:
skiffer-git
2024-05-10 21:30:12 +08:00
parent 21eb693629
commit 95a1e331b7
3 changed files with 7 additions and 6 deletions
@@ -28,13 +28,14 @@ const (
zookeeperConst = "zookeeper"
kubenetesConst = "k8s"
directConst = "direct"
etcdConst = "etcd"
etcd = "etcd"
)
// NewDiscoveryRegister creates a new service discovery and registry client based on the provided environment type.
func NewDiscoveryRegister(zookeeperConfig *config.ZooKeeper, share *config.Share) (discovery.SvcDiscoveryRegistry, error) {
func NewDiscoveryRegister(zookeeperConfig *config.ZooKeeper, share *config.Share) (discovery.SvcDiscoveryRegistry1, error) {
switch share.Env {
case zookeeperConst:
return zookeeper.NewZkClient(
zookeeperConfig.Address,
zookeeperConfig.Schema,
@@ -45,7 +46,7 @@ func NewDiscoveryRegister(zookeeperConfig *config.ZooKeeper, share *config.Share
)
case kubenetesConst:
return kubernetes.NewK8sDiscoveryRegister(share.RpcRegisterName.MessageGateway)
case etcdConst:
case etcd:
return getcd.NewSvcDiscoveryRegistry("openim", []string{"http://localhost:2379"})
case directConst:
//return direct.NewConnDirect(config)