Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ExecutionRequest ¶
type ExecutionRequest struct { ActionTitle string Action *config.Action Arguments map[string]string TrackingID string Tags []string Cfg *config.Config AuthenticatedUser *acl.AuthenticatedUser EntityPrefix string // contains filtered or unexported fields }
ExecutionRequest is a request to execute an action. It's passed to an Executor. They're created from the grpcapi.
type Executor ¶
type Executor struct { Logs map[string]*InternalLogEntry // contains filtered or unexported fields }
Executor represents a helper class for executing commands. It's main method is ExecRequest
func DefaultExecutor ¶
func DefaultExecutor() *Executor
DefaultExecutor returns an Executor, with a sensible "chain of command" for executing actions.
func (*Executor) AddListener ¶
func (e *Executor) AddListener(m listener)
func (*Executor) ExecRequest ¶
func (e *Executor) ExecRequest(req *ExecutionRequest) (*sync.WaitGroup, string)
ExecRequest processes an ExecutionRequest
type InternalLogEntry ¶
type InternalLogEntry struct { DatetimeStarted string DatetimeFinished string Stdout string Stderr string StdoutBuffer io.ReadCloser StderrBuffer io.ReadCloser TimedOut bool Blocked bool ExitCode int32 Tags []string ExecutionStarted bool ExecutionFinished bool ExecutionTrackingID string /* The following 3 properties are obviously on Action normally, but it's useful that logs are lightweight (so we don't need to have an action associated to logs, etc. Therefore, we duplicate those values here. */ ActionTitle string ActionIcon string ActionId string }
InternalLogEntry objects are created by an Executor, and represent the final state of execution (even if the command is not executed). It's designed to be easily serializable.
Click to show internal directories.
Click to hide internal directories.