1 Star 0 Fork 0

yanghao / go-admin-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
watcher.go 382 Bytes
一键复制 编辑 原始数据 按行查看 历史
yanghao 提交于 2021-12-06 13:03 . .
package memory
import (
"github.com/go-admin-team/go-admin-core/config/source"
)
type watcher struct {
Id string
Updates chan *source.ChangeSet
Source *memory
}
func (w *watcher) Next() (*source.ChangeSet, error) {
cs := <-w.Updates
return cs, nil
}
func (w *watcher) Stop() error {
w.Source.Lock()
delete(w.Source.Watchers, w.Id)
w.Source.Unlock()
return nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fexeak/go-admin-core.git
git@gitee.com:fexeak/go-admin-core.git
fexeak
go-admin-core
go-admin-core
v1.0.2

搜索帮助

344bd9b3 5694891 D2dac590 5694891