Documentation
¶
Index ¶
- func CallTask(t Task, args ...interface{}) ([]interface{}, error)
- func GetFunctionName(t Task) (string, error)
- func VerifySignature(t Task) error
- type Options
- type Retry
- type Task
- type TaskContext
- type TaskInfo
- type TaskResult
- type Tasks
- func (t *Tasks) ExecuteTaskByName(name string, tctx TaskContext, input ...interface{}) ([]interface{}, error)
- func (t *Tasks) GetTaskByName(name string) (Task, error)
- func (t *Tasks) GetTaskInfoByName(name string) (*TaskInfo, error)
- func (t *Tasks) GetTaskNames() []string
- func (t *Tasks) RegisterTask(task Task) error
- func (t *Tasks) RegisterTaskWithOptions(task Task, options *Options) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFunctionName ¶
GetFunctionName returns the short name of the given Task (function).
func VerifySignature ¶
Types ¶
type Options ¶
type Options struct {
Retry *Retry `json:"retry,omitempty"`
}
Options contains configuration options for a task
type Retry ¶
type Retry struct {
MaxRetries int `json:"max_retries"`
WaitDuration time.Duration `json:"wait_duration"`
Factor float32 `json:"factor"`
}
Retry contains retry configuration for a task
type TaskContext ¶
type TaskContext interface {
ExecuteTask(task Task, input ...interface{}) *TaskResult
}
type TaskResult ¶
type TaskResult struct {
Result []interface{}
Error error
}
func (*TaskResult) Get ¶
func (t *TaskResult) Get(output ...interface{}) error
type Tasks ¶
func (*Tasks) ExecuteTaskByName ¶
func (t *Tasks) ExecuteTaskByName(name string, tctx TaskContext, input ...interface{}) ([]interface{}, error)
func (*Tasks) GetTaskNames ¶
func (*Tasks) RegisterTask ¶
Click to show internal directories.
Click to hide internal directories.