mirror of
https://github.com/InazumaV/Ratte.git
synced 2026-02-03 20:20:14 +00:00
18 lines
268 B
Go
18 lines
268 B
Go
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)
|
|
}
|