1 Star 0 Fork 0

ww156 / notify

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
notify.go 324 Bytes
一键复制 编辑 原始数据 按行查看 历史
ww156 提交于 2021-12-17 10:41 . first commit
package notify
import "context"
// Notifier
type Notifier interface {
Notify(ctx context.Context) error
Type() string
}
// 重试
func Retry(notice Notifier, count int) error {
var err error
for i := 0; i < count; i++ {
err = notice.Notify(context.Background())
if err == nil {
return nil
}
}
return err
}
1
https://gitee.com/childewang/notify.git
git@gitee.com:childewang/notify.git
childewang
notify
notify
34056af3f771

搜索帮助