Add etcd as a service discovery mechanism

This commit is contained in:
skiffer-git
2024-05-11 15:40:17 +08:00
parent add7ea8ef0
commit e94598f5c1
32 changed files with 161 additions and 108 deletions
+2 -2
View File
@@ -44,7 +44,7 @@ import (
)
// Start rpc server.
func Start[T any](ctx context.Context, zookeeperConfig *config2.ZooKeeper, prometheusConfig *config2.Prometheus, listenIP,
func Start[T any](ctx context.Context, discovery *config2.Discovery, prometheusConfig *config2.Prometheus, listenIP,
registerIP string, rpcPorts []int, index int, rpcRegisterName string, share *config2.Share, config T, rpcFn func(ctx context.Context,
config T, client discovery.SvcDiscoveryRegistry, server *grpc.Server) error, options ...grpc.ServerOption) error {
@@ -68,7 +68,7 @@ func Start[T any](ctx context.Context, zookeeperConfig *config2.ZooKeeper, prome
}
defer listener.Close()
client, err := kdisc.NewDiscoveryRegister(zookeeperConfig, share)
client, err := kdisc.NewDiscoveryRegister(discovery, share)
if err != nil {
return err
}