Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler struct { eh.EventHandler // contains filtered or unexported fields }
EventHandler is a cron runner that inserts timed events into the event stream. It uses the cron syntax from https://github.com/gorhill/cronexpr.
func NewEventHandler ¶
func NewEventHandler(eventHandler eh.EventHandler) *EventHandler
NewEventHandler creates a new EventHandler.
func (*EventHandler) Error ¶
func (h *EventHandler) Error() <-chan error
Error returns the error channel.
func (*EventHandler) ScheduleEvent ¶
func (h *EventHandler) ScheduleEvent(ctx context.Context, cronLine string, eventFunc func(time.Time) eh.Event) error
ScheduleEvent schedules an event to be sent on regular intervals, using a line in the crontab format to setup the timing. The eventFunc should create the event to send given the triggered time as input. Cancelling the context will stop the triggering of more events.
Click to show internal directories.
Click to hide internal directories.