Feat registry consul (#445)

Co-authored-by: johnlanni <zty98751@alibaba-inc.com>
This commit is contained in:
Jun
2023-08-01 16:16:28 +08:00
committed by GitHub
parent e5105a4d71
commit 9b88c6bb40
16 changed files with 1049 additions and 84 deletions

View File

@@ -64,6 +64,7 @@ type watcher struct {
client *versionedclient.Clientset
isStop bool
updateCacheWhenEmpty bool
authOption provider.AuthOption
}
type WatcherOption func(w *watcher)
@@ -193,6 +194,12 @@ func WithUpdateCacheWhenEmpty(enable bool) WatcherOption {
}
}
func WithAuthOption(authOption provider.AuthOption) WatcherOption {
return func(w *watcher) {
w.authOption = authOption
}
}
func (w *watcher) Run() {
ticker := time.NewTicker(time.Duration(w.NacosRefreshInterval))
defer ticker.Stop()