代码拉取完成,页面将自动刷新
package mock
import (
"github.com/micro/go-plugins/registry/kubernetes/client"
"github.com/micro/go-plugins/registry/kubernetes/client/watch"
)
type mockWatcher struct {
results chan watch.Event
stop chan bool
}
// Changes returns the results channel
func (w *mockWatcher) ResultChan() <-chan watch.Event {
return w.results
}
// Stop closes any channels
func (w *mockWatcher) Stop() {
select {
case <-w.stop:
return
default:
close(w.stop)
close(w.results)
}
}
func updateMetadata(a, b *client.Meta) {
if a == nil || b == nil {
return
}
if b.Labels != nil {
for lk, lv := range b.Labels {
labels := a.Labels
if lv == nil {
delete(labels, lk)
continue
}
labels[lk] = lv
}
}
if b.Annotations != nil {
for ak, av := range b.Annotations {
ann := a.Annotations
if av == nil {
delete(ann, ak)
continue
}
ann[ak] = av
}
}
}
func labelFilterMatch(a map[string]*string, b map[string]string) bool {
match := true
for lk, lv := range b {
ml, ok := a[lk]
if !ok || *ml != lv {
match = false
break
}
}
return match
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。