Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interval ¶
type Repository ¶ added in v0.157.0
type Repository interface { Locks() guard.LockerFactory[StateID] States() StateRepository }
type Scheduler ¶
type Scheduler struct{ Repository Repository }
func (Scheduler) WithSchedule ¶
Example ¶
package main import ( "context" "github.com/adamluzsi/frameless/pkg/tasker/schedule" "log" ) func main() { scheduler := schedule.Scheduler{ Repository: nil, // &postgresql.TaskerScheduleRepository{CM: cm}, } task := scheduler.WithSchedule("db maintenance", schedule.Monthly{Day: 1}, func(ctx context.Context) error { return nil }) if err := task(context.Background()); err != nil { log.Println("ERROR", err.Error()) } }
Output:
type StateRepository ¶
Click to show internal directories.
Click to hide internal directories.