Documentation ¶
Index ¶
- Variables
- func ExecutionCompleteToSnapshot(event *dashboardevents.ExecutionComplete) *dashboardtypes.SteampipeSnapshot
- func GenerateSnapshot(ctx context.Context, target string, initData *initialisation.InitData, ...) (snapshot *dashboardtypes.SteampipeSnapshot, err error)
- func GetReferencedVariables(root dashboardtypes.DashboardNodeRun, w *workspace.Workspace) map[string]string
- type CheckRun
- func (r *CheckRun) AsTreeNode() *dashboardtypes.SnapshotTreeNode
- func (r *CheckRun) BuildSnapshotPanels(leafNodeMap map[string]dashboardtypes.SnapshotPanel) map[string]dashboardtypes.SnapshotPanel
- func (r *CheckRun) ChildrenComplete() bool
- func (r *CheckRun) Execute(ctx context.Context)
- func (r *CheckRun) GetChildren() []dashboardtypes.DashboardNodeRun
- func (r *CheckRun) GetError() error
- func (r *CheckRun) GetInputsDependingOn(changedInputName string) []string
- func (r *CheckRun) GetName() string
- func (r *CheckRun) GetRunStatus() dashboardtypes.DashboardRunStatus
- func (r *CheckRun) GetTitle() string
- func (r *CheckRun) Initialise(ctx context.Context)
- func (*CheckRun) IsSnapshotPanel()
- func (r *CheckRun) RunComplete() bool
- func (r *CheckRun) SetComplete(ctx context.Context)
- func (r *CheckRun) SetError(ctx context.Context, err error)
- type DashboardContainerRun
- func (r *DashboardContainerRun) AsTreeNode() *dashboardtypes.SnapshotTreeNode
- func (r *DashboardContainerRun) ChildCompleteChan() chan dashboardtypes.DashboardNodeRun
- func (r *DashboardContainerRun) ChildrenComplete() bool
- func (r *DashboardContainerRun) Execute(ctx context.Context)
- func (r *DashboardContainerRun) GetChildren() []dashboardtypes.DashboardNodeRun
- func (r *DashboardContainerRun) GetError() error
- func (r *DashboardContainerRun) GetInputsDependingOn(changedInputName string) []string
- func (r *DashboardContainerRun) GetName() string
- func (r *DashboardContainerRun) GetRunStatus() dashboardtypes.DashboardRunStatus
- func (r *DashboardContainerRun) GetTitle() string
- func (r *DashboardContainerRun) Initialise(ctx context.Context)
- func (*DashboardContainerRun) IsSnapshotPanel()
- func (r *DashboardContainerRun) RunComplete() bool
- func (r *DashboardContainerRun) SetComplete(context.Context)
- func (r *DashboardContainerRun) SetError(_ context.Context, err error)
- type DashboardEventControlHooks
- func (c *DashboardEventControlHooks) OnComplete(ctx context.Context, _ *controlstatus.ControlProgress)
- func (c *DashboardEventControlHooks) OnControlComplete(ctx context.Context, controlRun controlstatus.ControlRunStatusProvider, ...)
- func (c *DashboardEventControlHooks) OnControlError(ctx context.Context, controlRun controlstatus.ControlRunStatusProvider, ...)
- func (c *DashboardEventControlHooks) OnControlStart(context.Context, controlstatus.ControlRunStatusProvider, ...)
- func (c *DashboardEventControlHooks) OnStart(ctx context.Context, _ *controlstatus.ControlProgress)
- type DashboardExecutionTree
- func (e *DashboardExecutionTree) BuildSnapshotPanels() map[string]dashboardtypes.SnapshotPanel
- func (e *DashboardExecutionTree) Cancel()
- func (e *DashboardExecutionTree) ChildCompleteChan() chan dashboardtypes.DashboardNodeRun
- func (e *DashboardExecutionTree) Execute(ctx context.Context)
- func (e *DashboardExecutionTree) GetInputValue(name string) interface{}
- func (e *DashboardExecutionTree) GetName() string
- func (e *DashboardExecutionTree) GetRunStatus() dashboardtypes.DashboardRunStatus
- func (e *DashboardExecutionTree) RuntimeDependencies() []string
- func (e *DashboardExecutionTree) SetError(ctx context.Context, err error)
- func (e *DashboardExecutionTree) SetInputs(inputValues map[string]interface{})
- type DashboardExecutor
- func (e *DashboardExecutor) CancelExecutionForSession(_ context.Context, sessionId string)
- func (e *DashboardExecutor) ExecuteDashboard(ctx context.Context, sessionId, dashboardName string, ...) (err error)
- func (e *DashboardExecutor) LoadSnapshot(ctx context.Context, sessionId, snapshotName string, w *workspace.Workspace) (map[string]any, error)
- func (e *DashboardExecutor) OnInputChanged(ctx context.Context, sessionId string, inputs map[string]interface{}, ...) error
- type DashboardRun
- func (r *DashboardRun) AsTreeNode() *dashboardtypes.SnapshotTreeNode
- func (r *DashboardRun) ChildCompleteChan() chan dashboardtypes.DashboardNodeRun
- func (r *DashboardRun) ChildrenComplete() bool
- func (r *DashboardRun) Execute(ctx context.Context)
- func (r *DashboardRun) GetChildren() []dashboardtypes.DashboardNodeRun
- func (r *DashboardRun) GetError() error
- func (r *DashboardRun) GetInput(name string) (*modconfig.DashboardInput, bool)
- func (r *DashboardRun) GetInputsDependingOn(changedInputName string) []string
- func (r *DashboardRun) GetName() string
- func (r *DashboardRun) GetRunStatus() dashboardtypes.DashboardRunStatus
- func (r *DashboardRun) GetTitle() string
- func (r *DashboardRun) Initialise(ctx context.Context)
- func (*DashboardRun) IsSnapshotPanel()
- func (r *DashboardRun) RunComplete() bool
- func (r *DashboardRun) SetComplete(context.Context)
- func (r *DashboardRun) SetError(_ context.Context, err error)
- type LeafRun
- func (r *LeafRun) AsTreeNode() *dashboardtypes.SnapshotTreeNode
- func (r *LeafRun) ChildCompleteChan() chan dashboardtypes.DashboardNodeRun
- func (r *LeafRun) ChildrenComplete() bool
- func (r *LeafRun) Execute(ctx context.Context)
- func (r *LeafRun) GetChildren() []dashboardtypes.DashboardNodeRun
- func (r *LeafRun) GetError() error
- func (r *LeafRun) GetInputsDependingOn(changedInputName string) []string
- func (r *LeafRun) GetName() string
- func (r *LeafRun) GetRunStatus() dashboardtypes.DashboardRunStatus
- func (r *LeafRun) GetTitle() string
- func (r *LeafRun) Initialise(ctx context.Context)
- func (*LeafRun) IsSnapshotPanel()
- func (r *LeafRun) RunComplete() bool
- func (r *LeafRun) SetComplete(ctx context.Context)
- func (r *LeafRun) SetError(ctx context.Context, err error)
- type ResolvedRuntimeDependency
Constants ¶
This section is empty.
Variables ¶
var Executor = newDashboardExecutor()
Functions ¶
func ExecutionCompleteToSnapshot ¶ added in v0.17.0
func ExecutionCompleteToSnapshot(event *dashboardevents.ExecutionComplete) *dashboardtypes.SteampipeSnapshot
ExecutionCompleteToSnapshot transforms the ExecutionComplete event into a SteampipeSnapshot
func GenerateSnapshot ¶ added in v0.17.0
func GenerateSnapshot(ctx context.Context, target string, initData *initialisation.InitData, inputs map[string]interface{}) (snapshot *dashboardtypes.SteampipeSnapshot, err error)
func GetReferencedVariables ¶ added in v0.17.0
func GetReferencedVariables(root dashboardtypes.DashboardNodeRun, w *workspace.Workspace) map[string]string
GetReferencedVariables builds map of variables values containing only those mod variables which are referenced
Types ¶
type CheckRun ¶
type CheckRun struct { Name string `json:"name"` Title string `json:"title,omitempty"` Width int `json:"width,omitempty"` Description string `json:"description,omitempty"` Documentation string `json:"documentation,omitempty"` Display string `json:"display,omitempty"` Type string `json:"display_type,omitempty"` Tags map[string]string `json:"tags,omitempty"` ErrorString string `json:"error,omitempty"` NodeType string `json:"panel_type"` DashboardName string `json:"dashboard"` SourceDefinition string `json:"source_definition"` Summary *controlexecute.GroupSummary `json:"summary"` SessionId string `json:"-"` // if the dashboard node is a control, serialise to json as 'properties' Control *modconfig.Control `json:"properties,omitempty"` DashboardNode modconfig.DashboardLeafNode `json:"-"` Root controlexecute.ExecutionTreeNode `json:"-"` // contains filtered or unexported fields }
CheckRun is a struct representing the execution of a control or benchmark
func NewCheckRun ¶
func NewCheckRun(resource modconfig.DashboardLeafNode, parent dashboardtypes.DashboardNodeParent, executionTree *DashboardExecutionTree) (*CheckRun, error)
func (*CheckRun) AsTreeNode ¶
func (r *CheckRun) AsTreeNode() *dashboardtypes.SnapshotTreeNode
func (*CheckRun) BuildSnapshotPanels ¶ added in v0.17.0
func (r *CheckRun) BuildSnapshotPanels(leafNodeMap map[string]dashboardtypes.SnapshotPanel) map[string]dashboardtypes.SnapshotPanel
BuildSnapshotPanels is a custom implementation of BuildSnapshotPanels - be nice to just use the DashboardExecutionTree but work is needed on common interface types/generics
func (*CheckRun) ChildrenComplete ¶
ChildrenComplete implements DashboardNodeRun
func (*CheckRun) GetChildren ¶
func (r *CheckRun) GetChildren() []dashboardtypes.DashboardNodeRun
GetChildren implements DashboardNodeRun
func (*CheckRun) GetInputsDependingOn ¶
GetInputsDependingOn implements DashboardNodeRun return nothing for CheckRun
func (*CheckRun) GetRunStatus ¶
func (r *CheckRun) GetRunStatus() dashboardtypes.DashboardRunStatus
GetRunStatus implements DashboardNodeRun
func (*CheckRun) Initialise ¶
Initialise implements DashboardRunNode
func (*CheckRun) IsSnapshotPanel ¶
func (*CheckRun) IsSnapshotPanel()
IsSnapshotPanel implements SnapshotPanel
func (*CheckRun) RunComplete ¶
RunComplete implements DashboardNodeRun
func (*CheckRun) SetComplete ¶
SetComplete implements DashboardNodeRun
type DashboardContainerRun ¶
type DashboardContainerRun struct { Name string `json:"name"` Title string `json:"title,omitempty"` Width int `json:"width,omitempty"` Display string `json:"display,omitempty"` ErrorString string `json:"error,omitempty"` NodeType string `json:"panel_type"` Status dashboardtypes.DashboardRunStatus `json:"status"` DashboardName string `json:"dashboard"` SourceDefinition string `json:"source_definition"` // contains filtered or unexported fields }
DashboardContainerRun is a struct representing a container run
func NewDashboardContainerRun ¶
func NewDashboardContainerRun(container *modconfig.DashboardContainer, parent dashboardtypes.DashboardNodeParent, executionTree *DashboardExecutionTree) (*DashboardContainerRun, error)
func (*DashboardContainerRun) AsTreeNode ¶
func (r *DashboardContainerRun) AsTreeNode() *dashboardtypes.SnapshotTreeNode
func (*DashboardContainerRun) ChildCompleteChan ¶
func (r *DashboardContainerRun) ChildCompleteChan() chan dashboardtypes.DashboardNodeRun
ChildCompleteChan implements DashboardNodeParent
func (*DashboardContainerRun) ChildrenComplete ¶
func (r *DashboardContainerRun) ChildrenComplete() bool
ChildrenComplete implements DashboardNodeRun
func (*DashboardContainerRun) Execute ¶
func (r *DashboardContainerRun) Execute(ctx context.Context)
Execute implements DashboardRunNode execute all children and wait for them to complete
func (*DashboardContainerRun) GetChildren ¶
func (r *DashboardContainerRun) GetChildren() []dashboardtypes.DashboardNodeRun
GetChildren implements DashboardNodeRun
func (*DashboardContainerRun) GetError ¶
func (r *DashboardContainerRun) GetError() error
GetError implements DashboardNodeRun
func (*DashboardContainerRun) GetInputsDependingOn ¶
func (r *DashboardContainerRun) GetInputsDependingOn(changedInputName string) []string
GetInputsDependingOn implements DashboardNodeRun return nothing for DashboardContainerRun
func (*DashboardContainerRun) GetName ¶
func (r *DashboardContainerRun) GetName() string
GetName implements DashboardNodeRun
func (*DashboardContainerRun) GetRunStatus ¶
func (r *DashboardContainerRun) GetRunStatus() dashboardtypes.DashboardRunStatus
GetRunStatus implements DashboardNodeRun
func (*DashboardContainerRun) GetTitle ¶ added in v0.17.0
func (r *DashboardContainerRun) GetTitle() string
GetTitle implements DashboardNodeRun
func (*DashboardContainerRun) Initialise ¶
func (r *DashboardContainerRun) Initialise(ctx context.Context)
Initialise implements DashboardRunNode
func (*DashboardContainerRun) IsSnapshotPanel ¶
func (*DashboardContainerRun) IsSnapshotPanel()
IsSnapshotPanel implements SnapshotPanel
func (*DashboardContainerRun) RunComplete ¶
func (r *DashboardContainerRun) RunComplete() bool
RunComplete implements DashboardNodeRun
func (*DashboardContainerRun) SetComplete ¶
func (r *DashboardContainerRun) SetComplete(context.Context)
SetComplete implements DashboardNodeRun
type DashboardEventControlHooks ¶ added in v0.17.0
type DashboardEventControlHooks struct {
CheckRun *CheckRun
}
DashboardEventControlHooks is a struct which implements ControlHooks, and raises ControlComplete and ControlError dashboard events
func NewDashboardEventControlHooks ¶ added in v0.17.0
func NewDashboardEventControlHooks(r *CheckRun) *DashboardEventControlHooks
func (*DashboardEventControlHooks) OnComplete ¶ added in v0.17.0
func (c *DashboardEventControlHooks) OnComplete(ctx context.Context, _ *controlstatus.ControlProgress)
func (*DashboardEventControlHooks) OnControlComplete ¶ added in v0.17.0
func (c *DashboardEventControlHooks) OnControlComplete(ctx context.Context, controlRun controlstatus.ControlRunStatusProvider, progress *controlstatus.ControlProgress)
func (*DashboardEventControlHooks) OnControlError ¶ added in v0.17.0
func (c *DashboardEventControlHooks) OnControlError(ctx context.Context, controlRun controlstatus.ControlRunStatusProvider, progress *controlstatus.ControlProgress)
func (*DashboardEventControlHooks) OnControlStart ¶ added in v0.17.0
func (c *DashboardEventControlHooks) OnControlStart(context.Context, controlstatus.ControlRunStatusProvider, *controlstatus.ControlProgress)
func (*DashboardEventControlHooks) OnStart ¶ added in v0.17.0
func (c *DashboardEventControlHooks) OnStart(ctx context.Context, _ *controlstatus.ControlProgress)
type DashboardExecutionTree ¶
type DashboardExecutionTree struct { Root dashboardtypes.DashboardNodeRun // contains filtered or unexported fields }
DashboardExecutionTree is a structure representing the control result hierarchy
func (*DashboardExecutionTree) BuildSnapshotPanels ¶ added in v0.17.0
func (e *DashboardExecutionTree) BuildSnapshotPanels() map[string]dashboardtypes.SnapshotPanel
func (*DashboardExecutionTree) Cancel ¶
func (e *DashboardExecutionTree) Cancel()
func (*DashboardExecutionTree) ChildCompleteChan ¶
func (e *DashboardExecutionTree) ChildCompleteChan() chan dashboardtypes.DashboardNodeRun
ChildCompleteChan implements DashboardNodeParent
func (*DashboardExecutionTree) Execute ¶
func (e *DashboardExecutionTree) Execute(ctx context.Context)
func (*DashboardExecutionTree) GetInputValue ¶
func (e *DashboardExecutionTree) GetInputValue(name string) interface{}
func (*DashboardExecutionTree) GetName ¶
func (e *DashboardExecutionTree) GetName() string
GetName implements DashboardNodeParent use mod chort name - this will be the root name for all child runs
func (*DashboardExecutionTree) GetRunStatus ¶
func (e *DashboardExecutionTree) GetRunStatus() dashboardtypes.DashboardRunStatus
GetRunStatus returns the stats of the Root run
func (*DashboardExecutionTree) RuntimeDependencies ¶ added in v0.17.0
func (e *DashboardExecutionTree) RuntimeDependencies() []string
RuntimeDependencies returns the runtime dependencies for all leaf nodes
func (*DashboardExecutionTree) SetError ¶
func (e *DashboardExecutionTree) SetError(ctx context.Context, err error)
SetError sets the error on the Root run
func (*DashboardExecutionTree) SetInputs ¶
func (e *DashboardExecutionTree) SetInputs(inputValues map[string]interface{})
type DashboardExecutor ¶
type DashboardExecutor struct {
// contains filtered or unexported fields
}
func (*DashboardExecutor) CancelExecutionForSession ¶
func (e *DashboardExecutor) CancelExecutionForSession(_ context.Context, sessionId string)
func (*DashboardExecutor) ExecuteDashboard ¶
func (*DashboardExecutor) LoadSnapshot ¶ added in v0.17.0
func (*DashboardExecutor) OnInputChanged ¶
type DashboardRun ¶
type DashboardRun struct { Name string `json:"name"` Title string `json:"title,omitempty"` Width int `json:"width,omitempty"` Description string `json:"description,omitempty"` Display string `json:"display,omitempty"` Documentation string `json:"documentation,omitempty"` Tags map[string]string `json:"tags,omitempty"` ErrorString string `json:"error,omitempty"` NodeType string `json:"panel_type"` Status dashboardtypes.DashboardRunStatus `json:"status"` DashboardName string `json:"dashboard"` SourceDefinition string `json:"source_definition"` // contains filtered or unexported fields }
DashboardRun is a struct representing a container run
func NewDashboardRun ¶
func NewDashboardRun(dashboard *modconfig.Dashboard, parent dashboardtypes.DashboardNodeParent, executionTree *DashboardExecutionTree) (*DashboardRun, error)
func (*DashboardRun) AsTreeNode ¶
func (r *DashboardRun) AsTreeNode() *dashboardtypes.SnapshotTreeNode
func (*DashboardRun) ChildCompleteChan ¶
func (r *DashboardRun) ChildCompleteChan() chan dashboardtypes.DashboardNodeRun
func (*DashboardRun) ChildrenComplete ¶
func (r *DashboardRun) ChildrenComplete() bool
ChildrenComplete implements DashboardNodeRun
func (*DashboardRun) Execute ¶
func (r *DashboardRun) Execute(ctx context.Context)
Execute implements DashboardRunNode execute all children and wait for them to complete
func (*DashboardRun) GetChildren ¶
func (r *DashboardRun) GetChildren() []dashboardtypes.DashboardNodeRun
GetChildren implements DashboardNodeRun
func (*DashboardRun) GetError ¶
func (r *DashboardRun) GetError() error
GetError implements DashboardNodeRun
func (*DashboardRun) GetInput ¶
func (r *DashboardRun) GetInput(name string) (*modconfig.DashboardInput, bool)
GetInput searches for an input with the given name
func (*DashboardRun) GetInputsDependingOn ¶
func (r *DashboardRun) GetInputsDependingOn(changedInputName string) []string
GetInputsDependingOn returns a list o DashboardInputs which have a runtime depdendency on the given input
func (*DashboardRun) GetName ¶
func (r *DashboardRun) GetName() string
GetName implements DashboardNodeRun
func (*DashboardRun) GetRunStatus ¶
func (r *DashboardRun) GetRunStatus() dashboardtypes.DashboardRunStatus
GetRunStatus implements DashboardNodeRun
func (*DashboardRun) GetTitle ¶ added in v0.17.0
func (r *DashboardRun) GetTitle() string
GetTitle implements DashboardNodeRun
func (*DashboardRun) Initialise ¶
func (r *DashboardRun) Initialise(ctx context.Context)
Initialise implements DashboardRunNode
func (*DashboardRun) IsSnapshotPanel ¶
func (*DashboardRun) IsSnapshotPanel()
IsSnapshotPanel implements SnapshotPanel
func (*DashboardRun) RunComplete ¶
func (r *DashboardRun) RunComplete() bool
RunComplete implements DashboardNodeRun
func (*DashboardRun) SetComplete ¶
func (r *DashboardRun) SetComplete(context.Context)
SetComplete implements DashboardNodeRun
type LeafRun ¶
type LeafRun struct { Name string `json:"name"` Title string `json:"title,omitempty"` Width int `json:"width,omitempty"` Type string `cty:"type" hcl:"type" column:"type,text" json:"display_type,omitempty"` Display string `cty:"display" hcl:"display" json:"display,omitempty"` RawSQL string `json:"sql,omitempty"` Args []string `json:"args,omitempty"` Params []*modconfig.ParamDef `json:"params,omitempty"` Data *dashboardtypes.LeafData `json:"data,omitempty"` ErrorString string `json:"error,omitempty"` DashboardNode modconfig.DashboardLeafNode `json:"properties,omitempty"` NodeType string `json:"panel_type"` Status dashboardtypes.DashboardRunStatus `json:"status"` DashboardName string `json:"dashboard"` SourceDefinition string `json:"source_definition"` TimingResult *queryresult.TimingResult `json:"-"` // contains filtered or unexported fields }
LeafRun is a struct representing the execution of a leaf dashboard node
func NewLeafRun ¶
func NewLeafRun(resource modconfig.DashboardLeafNode, parent dashboardtypes.DashboardNodeParent, executionTree *DashboardExecutionTree) (*LeafRun, error)
func (*LeafRun) AsTreeNode ¶
func (r *LeafRun) AsTreeNode() *dashboardtypes.SnapshotTreeNode
func (*LeafRun) ChildCompleteChan ¶ added in v0.17.0
func (r *LeafRun) ChildCompleteChan() chan dashboardtypes.DashboardNodeRun
ChildCompleteChan implements DashboardNodeParent
func (*LeafRun) ChildrenComplete ¶
ChildrenComplete implements DashboardNodeRun
func (*LeafRun) GetChildren ¶
func (r *LeafRun) GetChildren() []dashboardtypes.DashboardNodeRun
GetChildren implements DashboardNodeRun
func (*LeafRun) GetInputsDependingOn ¶
GetInputsDependingOn implements DashboardNodeRun return nothing for LeafRun
func (*LeafRun) GetRunStatus ¶
func (r *LeafRun) GetRunStatus() dashboardtypes.DashboardRunStatus
GetRunStatus implements DashboardNodeRun
func (*LeafRun) Initialise ¶
Initialise implements DashboardRunNode
func (*LeafRun) IsSnapshotPanel ¶
func (*LeafRun) IsSnapshotPanel()
IsSnapshotPanel implements SnapshotPanel
func (*LeafRun) RunComplete ¶
RunComplete implements DashboardNodeRun
func (*LeafRun) SetComplete ¶
SetComplete implements DashboardNodeRun
type ResolvedRuntimeDependency ¶
type ResolvedRuntimeDependency struct {
// contains filtered or unexported fields
}
ResolvedRuntimeDependency is a wrapper for RuntimeDependency which contains the resolved value we must wrap it so that we do not mutate the underlying workspace data when resolving dependency values
func NewResolvedRuntimeDependency ¶
func NewResolvedRuntimeDependency(dep *modconfig.RuntimeDependency, executionTree *DashboardExecutionTree) *ResolvedRuntimeDependency
func (*ResolvedRuntimeDependency) Resolve ¶
func (d *ResolvedRuntimeDependency) Resolve() bool