mirror of
https://github.com/InazumaV/Ratte.git
synced 2026-02-04 12:40:12 +00:00
Initial commit
This commit is contained in:
17
trigger/schedule.go
Normal file
17
trigger/schedule.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package trigger
|
||||
|
||||
import "time"
|
||||
|
||||
type Schedule struct {
|
||||
interval int
|
||||
}
|
||||
|
||||
func newSchedule(interval int) *Schedule {
|
||||
return &Schedule{
|
||||
interval: interval,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Schedule) Next(t time.Time) time.Time {
|
||||
return t.Add(time.Duration(s.interval) * time.Second)
|
||||
}
|
||||
Reference in New Issue
Block a user