实现HTTP部分功能

This commit is contained in:
GoEdgeLab
2020-09-26 08:07:07 +08:00
parent d44fd0073c
commit 320ed5a1b6
39 changed files with 1960 additions and 230 deletions

View File

@@ -0,0 +1,15 @@
package utils
import "time"
// 定时运行某个函数
func Every(duration time.Duration, f func(ticker *Ticker)) *Ticker {
ticker := NewTicker(duration)
go func() {
for ticker.Next() {
f(ticker)
}
}()
return ticker
}