1 Star 0 Fork 0

sqos/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
signal_util.go 806 Bytes
一键复制 编辑 原始数据 按行查看 历史
package op
// Sig will send the Completed or Failed event to s depending
// on err being set if s is not nil.
func Sig(s Signaler, err error) {
if s != nil {
if err == nil {
s.Completed()
} else {
s.Failed()
}
}
}
// SigCompleted sends the Completed event to s if s is not nil.
func SigCompleted(s Signaler) {
if s != nil {
s.Completed()
}
}
// SigFailed sends the Failed event to s if s is not nil.
func SigFailed(s Signaler, err error) {
if s != nil {
s.Failed()
}
}
// SigAll send the Completed or Failed event to all given signalers
// depending on err being set.
func SigAll(signalers []Signaler, err error) {
if signalers == nil {
return
}
if err != nil {
for _, s := range signalers {
s.Failed()
}
return
}
for _, s := range signalers {
s.Failed()
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sqos/beats.git
git@gitee.com:sqos/beats.git
sqos
beats
beats
v5.4.3

搜索帮助

0d507c66 1850385 C8b1a773 1850385