Documentation ¶
Index ¶
- func NewResultLogEntryFromRequest(req *BlockExecutionRequest) *log.ResultLogEntry
- type BlockCancelRequest
- type BlockExecutionRequest
- type ExecutionUpdateFn
- type NodeIndex
- type Run
- func (r *Run) CancelBlock(nodeID, requestID string)
- func (r *Run) EditBlock(nodeID, blockID string, save bool) (*graph.Node, *graph.Block, error)
- func (r *Run) EditSnippet(nodeID string) (*graph.Node, error)
- func (r *Run) ExecuteBlock(n *graph.Node, b *graph.Block, stdout, stderr io.Writer) (string, error)
- func (r *Run) ExecuteNode(n *graph.Node, stdout, stderr io.Writer) error
- func (r *Run) GetBlock(nodeID, blockID string) (*graph.Block, error)
- func (r *Run) GetBlockExecutionResult(nodeID, logID string) (*log.ResultLogEntry, error)
- func (r *Run) ReportExecutionInfo(entry *log.ResultLogEntry) error
- func (r *Run) SetExecutionUpdateFn(fn ExecutionUpdateFn)
- func (r *Run) SetStatusUpdateFn(fn StatusUpdateFn)
- func (r *Run) Shutdown()
- func (r *Run) Start()
- func (r Run) String() string
- type Status
- type StatusLevel
- type StatusUpdateFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResultLogEntryFromRequest ¶
func NewResultLogEntryFromRequest(req *BlockExecutionRequest) *log.ResultLogEntry
Types ¶
type BlockCancelRequest ¶
func NewBlockCancelRequest ¶
func NewBlockCancelRequest(nodeID, requestID string) *BlockCancelRequest
type BlockExecutionRequest ¶
type BlockExecutionRequest struct { // CancelFn - can be called by multiple go routines, and is idempotent CancelFn context.CancelFunc Ctx context.Context ID string Node *graph.Node Block *graph.Block Stdout io.Writer Stderr io.Writer ExecutionID string ExecutedBy string }
func (*BlockExecutionRequest) String ¶
func (b *BlockExecutionRequest) String() string
type ExecutionUpdateFn ¶
type ExecutionUpdateFn func(entry *log.ResultLogEntry)
type NodeIndex ¶
func NewNodeViewIndex ¶
func NewNodeViewIndex() *NodeIndex
func (*NodeIndex) ContainsID ¶
type Run ¶
type Run struct { // Unique ID for this execution ID string // PlaybookID of the playbook snippet to run PlaybookID string // NodeView of the Root node of execution Root *graph.Node // NodeViews indexed by NodeID ViewIndex *NodeIndex // NodeExecutionResult indexed by NodeID ExecIndex log.ResultLogIndex // Store refers to the graph store Store graph.Store // Register is the execution library Register *executor.Register // contains filtered or unexported fields }
Run encapsulates a playbook's execution
func (*Run) CancelBlock ¶
func (*Run) ExecuteBlock ¶
ExecuteBlock executes the specified block in the context of this node
func (*Run) ExecuteNode ¶
ExecuteNode executes all code blocks in the context of this node If any block fails executions, ExecuteNode will return an error and not continue executing
func (*Run) GetBlockExecutionResult ¶
func (r *Run) GetBlockExecutionResult(nodeID, logID string) (*log.ResultLogEntry, error)
GetBlockExecutionResult retrieves the execution result for the specified LogID within that node
func (*Run) ReportExecutionInfo ¶
func (r *Run) ReportExecutionInfo(entry *log.ResultLogEntry) error
func (*Run) SetExecutionUpdateFn ¶
func (r *Run) SetExecutionUpdateFn(fn ExecutionUpdateFn)
func (*Run) SetStatusUpdateFn ¶
func (r *Run) SetStatusUpdateFn(fn StatusUpdateFn)
type Status ¶
type Status struct { Level StatusLevel Message string }
type StatusLevel ¶
type StatusLevel string
const ( StatusInfo StatusLevel = "Info" StatusError StatusLevel = "Error" )
type StatusUpdateFn ¶
type StatusUpdateFn func(*Status)
Click to show internal directories.
Click to hide internal directories.