forked from akuity/kargo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
- Loading branch information
Showing
9 changed files
with
121 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package directives | ||
|
||
import "context" | ||
|
||
// mockDirective is a mock implementation of the Directive interface, which can be | ||
// used for testing. | ||
type mockDirective struct { | ||
// name is the name of the Directive. | ||
name string | ||
// runFunc is the function that the step should call when Run is called. | ||
// If set, this function will be called instead of returning runResult | ||
// and runErr. | ||
runFunc func(context.Context, *StepContext) (Result, error) | ||
// runResult is the result that the Directive should return when Run is | ||
// called. | ||
runResult Result | ||
// runErr is the error that the Directive should return when Run is called. | ||
runErr error | ||
} | ||
|
||
func (d *mockDirective) Name() string { | ||
return d.name | ||
} | ||
|
||
func (d *mockDirective) Run(ctx context.Context, stepCtx *StepContext) (Result, error) { | ||
if d.runFunc != nil { | ||
return d.runFunc(ctx, stepCtx) | ||
} | ||
return d.runResult, d.runErr | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters