Add etcd as a service discovery mechanism

This commit is contained in:
skiffer-git
2024-05-11 16:58:49 +08:00
parent 678d361ccd
commit 16d2bf2220
2 changed files with 8 additions and 17 deletions
+1 -12
View File
@@ -45,22 +45,11 @@ func CheckZookeeper(ctx context.Context, config *config.ZooKeeper) error {
}
func CheckEtcd(ctx context.Context, config *config.Etcd) error {
etcd.Check(ctx, config.Address, "/check_openim_component",
return etcd.Check(ctx, config.Address, "/check_openim_component",
true,
etcd.WithDialTimeout(10*time.Second),
etcd.WithMaxCallSendMsgSize(20*1024*1024),
etcd.WithUsernameAndPassword(config.Username, config.Password))
return nil
}
func CheckDiscovery(ctx context.Context, config *config.Discovery) error {
switch config.Enable {
case "etcd":
return CheckEtcd(ctx, &config.Etcd)
}
return nil
}
func CheckMongo(ctx context.Context, config *config.Mongo) error {