Documentation ¶
Index ¶
- Constants
- func Execute(pluginVersion string, buildDate string, runner Runner)
- func GetValueFromContext(ctx context.Context, contextValueKey string, valueKey string) (interface{}, error)
- func PutValueToContextMap(ctx context.Context, contextValueKey string, key string, value interface{}) error
- func StartInputContextWatcher(onInputContextUpdateFunc ExecuteFunction, pluginVersion string, ...)
- type CommandFactoryBuilder
- type CommandRunner
- type ExecuteFunction
- type RunFunction
- type Runner
- type SimpleRunner
Constants ¶
const AbortContextFieldKey = "abortContextMap"
AbortContextFieldKey is a context key used to share data, such as a task ID, between an ongoing task and a potential abort task.
const ExecutionMode = "EXECUTOR_EXECUTION_MODE"
ExecutionMode is an environment variable that determines the execution mode of the executor.
const ExecutionModeDaemon = "daemon"
ExecutionModeDaemon represents the execution mode for running the executor as a daemon.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
Execute executes the runner with the provided plugin version, build date, and runner implementation.
func GetValueFromContext ¶ added in v0.2.37
func PutValueToContextMap ¶ added in v0.2.37
func StartInputContextWatcher ¶
func StartInputContextWatcher(onInputContextUpdateFunc ExecuteFunction, pluginVersion string, buildDate string, runner Runner)
StartInputContextWatcher starts the input context watcher that monitors changes in the input context secret. When a change is detected, the provided onInputContextUpdateFunc is invoked.
Types ¶
type CommandFactoryBuilder ¶ added in v0.2.37
type CommandFactoryBuilder func(input task.InputContext) (command.CommandFactory, error)
CommandFactoryBuilder represents the function signature for building a command factory.
type CommandRunner ¶
type CommandRunner struct {
// contains filtered or unexported fields
}
CommandRunner represents a command-based implementation of the Runner interface.
func NewCommandRunner ¶
func NewCommandRunner(factoryBuilder CommandFactoryBuilder) *CommandRunner
NewCommandRunner creates a new instance of CommandRunner
func (CommandRunner) Run ¶
func (runner CommandRunner) Run(ctx task.InputContext) *task.Result
Run executes the task using the command-based approach. The command is then executed asynchronously and waits for either an abort signal or for the execution to complete.
If an abort signal is received, it deserializes an abort command and executes it. The task result reflects the output of the abort command.
If the command finishes executing before an abort signal is received, the task result reflects the output of the executed command.
type ExecuteFunction ¶
ExecuteFunction represents the function signature for executing the runner.
type RunFunction ¶
type RunFunction func(task.InputContext) *task.Result
RunFunction represents the function signature for running a task.
type Runner ¶
type Runner interface {
Run(task.InputContext) *task.Result
}
Runner is an interface for executing a task.
type SimpleRunner ¶
type SimpleRunner struct {
// contains filtered or unexported fields
}
SimpleRunner represents a simple implementation of the Runner interface.
func NewSimpleRunner ¶
func NewSimpleRunner(run RunFunction) *SimpleRunner
NewSimpleRunner creates a new instance of SimpleRunner.
func (SimpleRunner) Run ¶
func (runner SimpleRunner) Run(ctx task.InputContext) *task.Result
Run executes the task using the provided RunFunction.