Documentation
¶
Index ¶
- Constants
- type DataEvent
- type Event
- type IntervalEvent
- type Runner
- func (r *Runner) DataEvent(ctx context.Context, data string, envs ...map[string]string) error
- func (r *Runner) Event(ctx context.Context, e Event) error
- func (r *Runner) Output(ctx context.Context) (string, error)
- func (r *Runner) Start()
- func (r *Runner) Status() bool
- func (r *Runner) Stop()
- func (r *Runner) Trigger() Event
- type Task
Constants ¶
View Source
const ( IntervalEventType int = iota DataEventType UserEventType )
Types of Events that exist in system
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataEvent ¶
type DataEvent struct {
// contains filtered or unexported fields
}
DataEvent occurs when new data comes from push service
type IntervalEvent ¶
type IntervalEvent struct {
// contains filtered or unexported fields
}
IntervalEvent occurs when user specific interval finishes
func (*IntervalEvent) Data ¶
func (i *IntervalEvent) Data() string
Data returns data associated with event
func (*IntervalEvent) Env ¶
func (i *IntervalEvent) Env(key string) string
Env returns value of given key
type Runner ¶
type Runner struct { ErrHandler func(error) // contains filtered or unexported fields }
Runner runs your task on sepecific events and stores outputs. ErrHandler calls on each run that have error in another thread so write it in async mode.
func NewWithoutOutput ¶
NewWithoutOutput creates new runner without any output channel
func (*Runner) Start ¶
func (r *Runner) Start()
Start starts runner and it must be call in new goroutine you can start many routine by call this function many times
Click to show internal directories.
Click to hide internal directories.