Documentation ¶
Index ¶
- func TypeSafetyCheck(name string, value string, argumentType string) error
- type ActionBinding
- type ExecutionRequest
- type Executor
- func (e *Executor) AddListener(m listener)
- func (e *Executor) ExecRequest(req *ExecutionRequest) (*sync.WaitGroup, string)
- func (e *Executor) FindActionBindingByID(id string) *config.Action
- func (e *Executor) GetLog(trackingID string) (*InternalLogEntry, bool)
- func (e *Executor) GetLogsByActionId(actionId string) []*InternalLogEntry
- func (e *Executor) GetLogsCopy() map[string]*InternalLogEntry
- func (e *Executor) Kill(execReq *InternalLogEntry) error
- func (e *Executor) RebuildActionMap()
- func (e *Executor) SetLog(trackingID string, entry *InternalLogEntry)
- type InternalLogEntry
- type OutputStreamer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionBinding ¶
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 { LogsByActionId map[string][]*InternalLogEntry MapActionIdToBinding map[string]*ActionBinding MapActionIdToBindingLock sync.RWMutex Cfg *config.Config // contains filtered or unexported fields }
Executor represents a helper class for executing commands. It's main method is ExecRequest
func DefaultExecutor ¶
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
func (*Executor) FindActionBindingByID ¶
func (*Executor) GetLogsByActionId ¶
func (e *Executor) GetLogsByActionId(actionId string) []*InternalLogEntry
func (*Executor) GetLogsCopy ¶
func (e *Executor) GetLogsCopy() map[string]*InternalLogEntry
func (*Executor) Kill ¶
func (e *Executor) Kill(execReq *InternalLogEntry) error
func (*Executor) RebuildActionMap ¶
func (e *Executor) RebuildActionMap()
func (*Executor) SetLog ¶
func (e *Executor) SetLog(trackingID string, entry *InternalLogEntry)
type InternalLogEntry ¶
type InternalLogEntry struct { DatetimeStarted time.Time DatetimeFinished time.Time Output string TimedOut bool Blocked bool ExitCode int32 Tags []string ExecutionStarted bool ExecutionFinished bool ExecutionTrackingID string Process *os.Process Username 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.
type OutputStreamer ¶
type OutputStreamer struct { Req *ExecutionRequest // contains filtered or unexported fields }
func (*OutputStreamer) String ¶
func (ost *OutputStreamer) String() string
Click to show internal directories.
Click to hide internal directories.