Documentation
¶
Overview ¶
Deprecated: This package is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go
Index ¶
- func NewDurableTask[I, O any](opts create.StandaloneTask, ...) workflow.WorkflowDeclaration[I, O]deprecated
- func NewTask[I, O any](opts create.StandaloneTask, ...) workflow.WorkflowDeclaration[I, O]deprecated
- func NewWorkflow[I any, O any](opts create.WorkflowCreateOpts[I], client v1.HatchetClient) workflow.WorkflowDeclaration[I, O]deprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDurableTask
deprecated
func NewDurableTask[I, O any](opts create.StandaloneTask, fn func(ctx worker.DurableHatchetContext, input I) (*O, error), client v1.HatchetClient) workflow.WorkflowDeclaration[I, O]
Deprecated: NewDurableTask is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go
NewDurableTask creates a durable task that is implemented as a simple workflow with a single task. It provides proper type inference for the input and output types.
Example:
type SimpleInput struct {
Message string
}
type SimpleOutput struct {
TransformedMessage string
}
simpleTask := v1.NewTask(v1.TaskCreateOpts[SimpleInput, SimpleOutput]{
Name: "simple-task",
Fn: func(input SimpleInput, ctx worker.DurableHatchetContext) (*SimpleOutput, error) {
return &SimpleOutput{
TransformedMessage: strings.ToLower(input.Message),
}, nil
},
}, &client)
func NewTask
deprecated
func NewTask[I, O any](opts create.StandaloneTask, fn func(ctx worker.HatchetContext, input I) (*O, error), client v1.HatchetClient) workflow.WorkflowDeclaration[I, O]
Deprecated: NewTask is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go
NewTask creates a standalone task that is implemented as a simple workflow with a single task. It provides proper type inference for the input and output types.
Example:
type SimpleInput struct {
Message string
}
type SimpleOutput struct {
TransformedMessage string
}
simpleTask := v1.NewTask(v1.TaskCreateOpts[SimpleInput, SimpleOutput]{
Name: "simple-task",
Fn: func(input SimpleInput, ctx worker.HatchetContext) (*SimpleOutput, error) {
return &SimpleOutput{
TransformedMessage: strings.ToLower(input.Message),
}, nil
},
}, &client)
func NewWorkflow
deprecated
func NewWorkflow[I any, O any](opts create.WorkflowCreateOpts[I], client v1.HatchetClient) workflow.WorkflowDeclaration[I, O]
Deprecated: NewWorkflow is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go
Types ¶
This section is empty.