Skip to content

Commit

Permalink
wip: add purge options
Browse files Browse the repository at this point in the history
  • Loading branch information
famarting committed Oct 14, 2024
1 parent 9bc7d82 commit 52318d3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions workflow/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ func WithRawOutput(data string) api.TerminateOptions {
return api.WithRawOutput(data)
}

// WithRecursiveTerminate configures whether to terminate all sub-workflows created by the target workflow.
func WithRecursiveTerminate(recursive bool) api.TerminateOptions {
return api.WithRecursiveTerminate(recursive)

Check warning on line 83 in workflow/client.go

View check run for this annotation

Codecov / codecov/patch

workflow/client.go#L82-L83

Added lines #L82 - L83 were not covered by tests
}

// WithRecursivePurge configures whether to purge all sub-workflows created by the target workflow.
func WithRecursivePurge(recursive bool) api.PurgeOptions {
return api.WithRecursivePurge(recursive)

Check warning on line 88 in workflow/client.go

View check run for this annotation

Codecov / codecov/patch

workflow/client.go#L87-L88

Added lines #L87 - L88 were not covered by tests
}

type clientOption func(*clientOptions) error

type clientOptions struct {
Expand Down Expand Up @@ -205,6 +215,7 @@ func (c *Client) ResumeWorkflow(ctx context.Context, id, reason string) error {

// PurgeWorkflow will purge a given workflow and return an error output.
// NOTE: The workflow must be in a terminated or completed state.
// TODO missing upstream support for api.PurgeOptions
func (c *Client) PurgeWorkflow(ctx context.Context, id string) error {
if id == "" {
return errors.New("no workflow id specified")
Expand Down

0 comments on commit 52318d3

Please sign in to comment.