command

package
v0.2.36 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandExecutor

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

CommandExecutor represents an executor for a command.

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.

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