command

package
v0.2.53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2024 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbortCommandType added in v0.2.37

type AbortCommandType CommandType

AbortCommandType represents the type of command that is to be used for aborting a running task. It differentiates between standard commands and abort commands, allowing different handling.

type CommandExecutor

type CommandExecutor interface {
	// FetchResult executes the command and returns the result.
	FetchResult(ctx context.Context) (*task.Result, error)
}

CommandExecutor represents an executor for a command.

func DeserializeAbortCommand added in v0.2.37

func DeserializeAbortCommand(factory CommandFactory, taskContext task.TaskContext) (CommandExecutor, error)

func DeserializeCommand

func DeserializeCommand(factory CommandFactory, taskContext task.TaskContext) (CommandExecutor, error)

DeserializeCommand deserializes a command from the task context using the provided command factory.

type CommandFactory

type CommandFactory interface {
	// InitCommand initializes and returns a CommandExecutor for the specified command type.
	// It returns an error if the command type is not supported.
	InitCommand(commandType CommandType) (CommandExecutor, error)
}

CommandFactory represents a factory for creating commands.

type CommandType

type CommandType string

CommandType represents the type of a command.

func AbortCommand added in v0.2.37

func AbortCommand(command CommandType) CommandType

AbortCommand is a wrapper for executing abort logic for a specified command

type CommandWrapper

type CommandWrapper struct {
	CommandType CommandType `json:"type"`
	Properties  interface{}
}

CommandWrapper represents a wrapper for a command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL