Documentation
¶
Index ¶
- func RunTask[T any](baseContext context.Context, task coretask.Task[T], ...) (T, error)
- func RunTaskWithDependency[T any](baseContext context.Context, mainTask coretask.Task[T], ...) (T, error)
- func StubTask[T any](mockTarget coretask.Task[T], mockResult T, mockError error) coretask.Task[T]
- func StubTaskFromReferenceID[T any](mockTargetReference taskid.TaskReference[T], mockResult T, mockError error) coretask.Task[T]
- func WithTaskResult[T any](ctx context.Context, taskRef taskid.TaskReference[T], value T) context.Context
- type TaskDependencyValues
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunTask ¶
func RunTask[T any](baseContext context.Context, task coretask.Task[T], taskDependencyValues ...TaskDependencyValues) (T, error)
RunTask runs a single task.
func RunTaskWithDependency ¶
func RunTaskWithDependency[T any](baseContext context.Context, mainTask coretask.Task[T], dependencies []coretask.UntypedTask) (T, error)
RunTaskWithDependency runs a task as a graph. Supply the dependencies of the main task to resolve the graph correctly.
func StubTask ¶
StubTask wraps a given task to return the constant values given without calling the original task.
func StubTaskFromReferenceID ¶
func StubTaskFromReferenceID[T any](mockTargetReference taskid.TaskReference[T], mockResult T, mockError error) coretask.Task[T]
StubTaskFromReferenceID creates a new test task return the given constant value of its result.
func WithTaskResult ¶
func WithTaskResult[T any](ctx context.Context, taskRef taskid.TaskReference[T], value T) context.Context
WithTaskResult adds task result to the given context. It's for testing a function using coretask.GetTaskResult inside.
Types ¶
type TaskDependencyValues ¶
func NewTaskDependencyValuePair ¶
func NewTaskDependencyValuePair[T any](key taskid.TaskReference[T], value T) TaskDependencyValues
NewTaskDependencyValuePair returns a new pair of a task reference and its value.
Click to show internal directories.
Click to hide internal directories.