Documentation ¶
Index ¶
- Constants
- func ExecutionCompleteToSnapshot(event *dashboardevents.ExecutionComplete) *steampipeconfig.SteampipeSnapshot
- func GenerateSnapshot(ctx context.Context, w *workspace.PowerpipeWorkspace, ...) (snapshot *steampipeconfig.SteampipeSnapshot, err error)
- func GetReferencedVariables(root dashboardtypes.DashboardTreeRun, w *workspace.PowerpipeWorkspace) (map[string]string, error)
- type CheckRun
- func (r *CheckRun) AsTreeNode() *steampipeconfig.SnapshotTreeNode
- func (r *CheckRun) BuildSnapshotPanels(leafNodeMap map[string]steampipeconfig.SnapshotPanel) map[string]steampipeconfig.SnapshotPanel
- func (r *CheckRun) ChildrenComplete() bool
- func (r *CheckRun) Execute(ctx context.Context)
- func (r *CheckRun) Initialise(ctx context.Context)
- func (*CheckRun) IsSnapshotPanel()
- func (r *CheckRun) SetComplete(ctx context.Context)
- func (r *CheckRun) SetError(ctx context.Context, err error)
- type DashboardContainerRun
- 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 (*DashboardExecutionTree) AsTreeNode() *steampipeconfig.SnapshotTreeNode
- func (e *DashboardExecutionTree) BuildSnapshotPanels() map[string]steampipeconfig.SnapshotPanel
- func (e *DashboardExecutionTree) Cancel()
- func (e *DashboardExecutionTree) ChildCompleteChan() chan dashboardtypes.DashboardTreeRun
- func (*DashboardExecutionTree) ChildStatusChanged(context.Context)
- func (e *DashboardExecutionTree) ChildrenComplete() bool
- func (e *DashboardExecutionTree) Execute(ctx context.Context)
- func (e *DashboardExecutionTree) GetChildren() []dashboardtypes.DashboardTreeRun
- func (e *DashboardExecutionTree) GetError() error
- func (e *DashboardExecutionTree) GetInputsDependingOn(s string) []string
- func (e *DashboardExecutionTree) GetName() string
- func (*DashboardExecutionTree) GetNodeType() string
- func (e *DashboardExecutionTree) GetParent() dashboardtypes.DashboardParent
- func (*DashboardExecutionTree) GetResource() resources.DashboardLeafNode
- func (e *DashboardExecutionTree) GetRunStatus() dashboardtypes.RunStatus
- func (e *DashboardExecutionTree) GetTitle() string
- func (e *DashboardExecutionTree) Initialise(ctx context.Context)
- func (e *DashboardExecutionTree) InputRuntimeDependencies() []string
- func (e *DashboardExecutionTree) RunComplete() bool
- func (e *DashboardExecutionTree) SetComplete(ctx context.Context)
- func (e *DashboardExecutionTree) SetError(ctx context.Context, err error)
- func (e *DashboardExecutionTree) SetInputValues(inputValues *InputValues)
- type DashboardExecutor
- func (e *DashboardExecutor) CancelExecutionForSession(_ context.Context, sessionId string)
- func (e *DashboardExecutor) ExecuteDashboard(ctx context.Context, sessionId string, rootResource modconfig.ModTreeItem, ...) (err error)
- func (e *DashboardExecutor) LoadSnapshot(ctx context.Context, sessionId, snapshotName string, ...) (map[string]any, error)
- func (e *DashboardExecutor) OnInputChanged(ctx context.Context, sessionId string, inputs *InputValues, ...) error
- type DashboardParentImpl
- type DashboardRun
- func (r *DashboardRun) AsTreeNode() *steampipeconfig.SnapshotTreeNode
- func (r *DashboardRun) Execute(ctx context.Context)
- func (r *DashboardRun) GetInput(name string) (*resources.DashboardInput, bool)
- func (r *DashboardRun) GetInputsDependingOn(changedInputName string) []string
- func (p *DashboardRun) GetName() string
- func (p *DashboardRun) GetWithRuns() map[string]*LeafRun
- func (r *DashboardRun) Initialise(ctx context.Context)
- func (*DashboardRun) IsSnapshotPanel()
- func (p *DashboardRun) ProvidesRuntimeDependency(dependency *resources.RuntimeDependency) bool
- func (p *DashboardRun) PublishRuntimeDependencyValue(name string, result *dashboardtypes.ResolvedRuntimeDependencyValue)
- func (p *DashboardRun) SubscribeToRuntimeDependency(name string, opts ...RuntimeDependencyPublishOption) chan *dashboardtypes.ResolvedRuntimeDependencyValue
- type DashboardTreeRunImpl
- func (r *DashboardTreeRunImpl) AsTreeNode() *steampipeconfig.SnapshotTreeNode
- func (r *DashboardTreeRunImpl) Execute(ctx context.Context)
- func (r *DashboardTreeRunImpl) GetError() error
- func (r *DashboardTreeRunImpl) GetInputsDependingOn(_ string) []string
- func (r *DashboardTreeRunImpl) GetName() string
- func (r *DashboardTreeRunImpl) GetNodeType() string
- func (r *DashboardTreeRunImpl) GetParent() dashboardtypes.DashboardParent
- func (r *DashboardTreeRunImpl) GetResource() resources.DashboardLeafNode
- func (r *DashboardTreeRunImpl) GetRunStatus() dashboardtypes.RunStatus
- func (r *DashboardTreeRunImpl) GetTitle() string
- func (r *DashboardTreeRunImpl) Initialise(context.Context)
- func (r *DashboardTreeRunImpl) RunComplete() bool
- func (r *DashboardTreeRunImpl) SetComplete(ctx context.Context)
- func (r *DashboardTreeRunImpl) SetError(ctx context.Context, err error)
- type DetectionBenchmarkDisplay
- func (r *DetectionBenchmarkDisplay) AddDetection(detectionRun *DetectionRun)
- func (r *DetectionBenchmarkDisplay) AddResultGroup(group *DetectionBenchmarkDisplay)
- func (r *DetectionBenchmarkDisplay) AllTagKeys() []string
- func (r *DetectionBenchmarkDisplay) AsTreeNode() *steampipeconfig.SnapshotTreeNode
- func (r *DetectionBenchmarkDisplay) GetChildGroupByName(name string) *DetectionBenchmarkDisplay
- func (r *DetectionBenchmarkDisplay) GetChildren() []controlexecute.ExecutionTreeNode
- func (r *DetectionBenchmarkDisplay) GetGroupByName(name string) *DetectionBenchmarkDisplay
- func (r *DetectionBenchmarkDisplay) GetName() string
- func (r *DetectionBenchmarkDisplay) GetRunByName(name string) *DetectionRun
- func (r *DetectionBenchmarkDisplay) GetSummary() *DetectionBenchmarkSummary
- func (*DetectionBenchmarkDisplay) IsExecutionTreeNode()
- func (*DetectionBenchmarkDisplay) IsSnapshotPanel()
- func (r *DetectionBenchmarkDisplay) RunCount() int
- func (r *DetectionBenchmarkDisplay) SetSummary()
- type DetectionBenchmarkDisplayTree
- type DetectionBenchmarkRun
- type DetectionBenchmarkSummary
- type DetectionRun
- func (r *DetectionRun) AsTreeNode() *steampipeconfig.SnapshotTreeNode
- func (r *DetectionRun) Execute(ctx context.Context)
- func (r *DetectionRun) GetChildren() []controlexecute.ExecutionTreeNode
- func (p *DetectionRun) GetName() string
- func (p *DetectionRun) GetWithRuns() map[string]*LeafRun
- func (p *DetectionRun) Initialise(context.Context)
- func (r *DetectionRun) IsExecutionTreeNode()
- func (*DetectionRun) IsSnapshotPanel()
- func (p *DetectionRun) ProvidesRuntimeDependency(dependency *resources.RuntimeDependency) bool
- func (p *DetectionRun) PublishRuntimeDependencyValue(name string, result *dashboardtypes.ResolvedRuntimeDependencyValue)
- func (r *DetectionRun) SetComplete(ctx context.Context)
- func (r *DetectionRun) SetError(ctx context.Context, err error)
- func (p *DetectionRun) SubscribeToRuntimeDependency(name string, opts ...RuntimeDependencyPublishOption) chan *dashboardtypes.ResolvedRuntimeDependencyValue
- type InputValues
- type LeafRun
- func (r *LeafRun) AsTreeNode() *steampipeconfig.SnapshotTreeNode
- func (r *LeafRun) Execute(ctx context.Context)
- func (p *LeafRun) GetName() string
- func (p *LeafRun) GetWithRuns() map[string]*LeafRun
- func (p *LeafRun) Initialise(context.Context)
- func (*LeafRun) IsSnapshotPanel()
- func (p *LeafRun) ProvidesRuntimeDependency(dependency *resources.RuntimeDependency) bool
- func (p *LeafRun) PublishRuntimeDependencyValue(name string, result *dashboardtypes.ResolvedRuntimeDependencyValue)
- func (r *LeafRun) SetComplete(ctx context.Context)
- func (r *LeafRun) SetError(ctx context.Context, err error)
- func (p *LeafRun) SubscribeToRuntimeDependency(name string, opts ...RuntimeDependencyPublishOption) chan *dashboardtypes.ResolvedRuntimeDependencyValue
- type LeafRunOption
- type RuntimeDependencyPublishOption
- type RuntimeDependencyPublishTarget
- type RuntimeDependencyPublisher
- type RuntimeDependencySubscriber
- type RuntimeDependencySubscriberImpl
- func (p *RuntimeDependencySubscriberImpl) AsTreeNode() *steampipeconfig.SnapshotTreeNode
- func (p *RuntimeDependencySubscriberImpl) Execute(context.Context)
- func (s *RuntimeDependencySubscriberImpl) GetBaseDependencySubscriber() RuntimeDependencySubscriber
- func (p *RuntimeDependencySubscriberImpl) GetName() string
- func (p *RuntimeDependencySubscriberImpl) GetWithRuns() map[string]*LeafRun
- func (p *RuntimeDependencySubscriberImpl) Initialise(context.Context)
- func (p *RuntimeDependencySubscriberImpl) ProvidesRuntimeDependency(dependency *resources.RuntimeDependency) bool
- func (p *RuntimeDependencySubscriberImpl) PublishRuntimeDependencyValue(name string, result *dashboardtypes.ResolvedRuntimeDependencyValue)
- func (p *RuntimeDependencySubscriberImpl) SubscribeToRuntimeDependency(name string, opts ...RuntimeDependencyPublishOption) chan *dashboardtypes.ResolvedRuntimeDependencyValue
- type SummaryProvider
Constants ¶
const RootResultGroup_Name = "root_result_group"
Variables ¶
This section is empty.
Functions ¶
func ExecutionCompleteToSnapshot ¶
func ExecutionCompleteToSnapshot(event *dashboardevents.ExecutionComplete) *steampipeconfig.SteampipeSnapshot
ExecutionCompleteToSnapshot transforms the ExecutionComplete event into a SteampipeSnapshot
func GenerateSnapshot ¶
func GenerateSnapshot(ctx context.Context, w *workspace.PowerpipeWorkspace, rootResource modconfig.ModTreeItem, inputs *InputValues) (snapshot *steampipeconfig.SteampipeSnapshot, err error)
func GetReferencedVariables ¶
func GetReferencedVariables(root dashboardtypes.DashboardTreeRun, w *workspace.PowerpipeWorkspace) (map[string]string, error)
GetReferencedVariables builds map of variables values containing only those mod variables which are referenced NOTE: we refer to variables in dependency mods in the format which is valid for an SPVARS filer, i.e. <mod>.<var-name> the VariableValues map will contain these variables with the name format <mod>.var.<var-name>, so we must convert the name
Types ¶
type CheckRun ¶
type CheckRun struct { DashboardParentImpl Summary *controlexecute.GroupSummary `json:"summary"` SessionId string `json:"-"` Root controlexecute.ExecutionTreeNode `json:"-"` BenchmarkType string `json:"benchmark_type"` // contains filtered or unexported fields }
CheckRun is a struct representing the execution of a control or benchmark
func NewCheckRun ¶
func NewCheckRun(resource resources.DashboardLeafNode, parent dashboardtypes.DashboardParent, executionTree *DashboardExecutionTree) (*CheckRun, error)
func (*CheckRun) AsTreeNode ¶
func (r *CheckRun) AsTreeNode() *steampipeconfig.SnapshotTreeNode
func (*CheckRun) BuildSnapshotPanels ¶
func (r *CheckRun) BuildSnapshotPanels(leafNodeMap map[string]steampipeconfig.SnapshotPanel) map[string]steampipeconfig.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 DashboardTreeRun (override base)
func (*CheckRun) Initialise ¶
Initialise implements DashboardTreeRun
func (*CheckRun) IsSnapshotPanel ¶
func (*CheckRun) IsSnapshotPanel()
IsSnapshotPanel implements SnapshotPanel
func (*CheckRun) SetComplete ¶
SetComplete implements DashboardTreeRun (override to set snapshothook status
type DashboardContainerRun ¶
type DashboardContainerRun struct { DashboardParentImpl // contains filtered or unexported fields }
DashboardContainerRun is a struct representing a container run
func NewDashboardContainerRun ¶
func NewDashboardContainerRun(container *resources.DashboardContainer, parent dashboardtypes.DashboardParent, executionTree *DashboardExecutionTree) (*DashboardContainerRun, error)
func (*DashboardContainerRun) AsTreeNode ¶
func (r *DashboardContainerRun) AsTreeNode() *steampipeconfig.SnapshotTreeNode
func (*DashboardContainerRun) Execute ¶
func (r *DashboardContainerRun) Execute(ctx context.Context)
Execute implements DashboardTreeRun execute all children and wait for them to complete
func (*DashboardContainerRun) Initialise ¶
func (r *DashboardContainerRun) Initialise(ctx context.Context)
Initialise implements DashboardTreeRun
func (*DashboardContainerRun) IsSnapshotPanel ¶
func (*DashboardContainerRun) IsSnapshotPanel()
IsSnapshotPanel implements SnapshotPanel
type DashboardEventControlHooks ¶
type DashboardEventControlHooks struct {
CheckRun *CheckRun
}
DashboardEventControlHooks is a struct which implements ControlHooks, and raises ControlComplete and ControlError dashboard events
func NewDashboardEventControlHooks ¶
func NewDashboardEventControlHooks(r *CheckRun) *DashboardEventControlHooks
func (*DashboardEventControlHooks) OnComplete ¶
func (c *DashboardEventControlHooks) OnComplete(ctx context.Context, _ *controlstatus.ControlProgress)
func (*DashboardEventControlHooks) OnControlComplete ¶
func (c *DashboardEventControlHooks) OnControlComplete(ctx context.Context, controlRun controlstatus.ControlRunStatusProvider, progress *controlstatus.ControlProgress)
func (*DashboardEventControlHooks) OnControlError ¶
func (c *DashboardEventControlHooks) OnControlError(ctx context.Context, controlRun controlstatus.ControlRunStatusProvider, progress *controlstatus.ControlProgress)
func (*DashboardEventControlHooks) OnControlStart ¶
func (c *DashboardEventControlHooks) OnControlStart(context.Context, controlstatus.ControlRunStatusProvider, *controlstatus.ControlProgress)
func (*DashboardEventControlHooks) OnStart ¶
func (c *DashboardEventControlHooks) OnStart(ctx context.Context, _ *controlstatus.ControlProgress)
type DashboardExecutionTree ¶
type DashboardExecutionTree struct { Root dashboardtypes.DashboardTreeRun DateTimeRange utils.TimeRange // contains filtered or unexported fields }
DashboardExecutionTree is a structure representing the control result hierarchy
func (*DashboardExecutionTree) AsTreeNode ¶
func (*DashboardExecutionTree) AsTreeNode() *steampipeconfig.SnapshotTreeNode
func (*DashboardExecutionTree) BuildSnapshotPanels ¶
func (e *DashboardExecutionTree) BuildSnapshotPanels() map[string]steampipeconfig.SnapshotPanel
func (*DashboardExecutionTree) Cancel ¶
func (e *DashboardExecutionTree) Cancel()
func (*DashboardExecutionTree) ChildCompleteChan ¶
func (e *DashboardExecutionTree) ChildCompleteChan() chan dashboardtypes.DashboardTreeRun
ChildCompleteChan implements DashboardParent
func (*DashboardExecutionTree) ChildStatusChanged ¶
func (*DashboardExecutionTree) ChildStatusChanged(context.Context)
ChildStatusChanged implements DashboardParent
func (*DashboardExecutionTree) ChildrenComplete ¶
func (e *DashboardExecutionTree) ChildrenComplete() bool
ChildrenComplete implements DashboardParent
func (*DashboardExecutionTree) Execute ¶
func (e *DashboardExecutionTree) Execute(ctx context.Context)
func (*DashboardExecutionTree) GetChildren ¶
func (e *DashboardExecutionTree) GetChildren() []dashboardtypes.DashboardTreeRun
GetChildren implements DashboardParent
func (*DashboardExecutionTree) GetError ¶
func (e *DashboardExecutionTree) GetError() error
func (*DashboardExecutionTree) GetInputsDependingOn ¶
func (e *DashboardExecutionTree) GetInputsDependingOn(s string) []string
func (*DashboardExecutionTree) GetName ¶
func (e *DashboardExecutionTree) GetName() string
GetName implements DashboardParent use mod short name - this will be the root name for all child runs
func (*DashboardExecutionTree) GetNodeType ¶
func (*DashboardExecutionTree) GetNodeType() string
GetNodeType implements DashboardTreeRun
func (*DashboardExecutionTree) GetParent ¶
func (e *DashboardExecutionTree) GetParent() dashboardtypes.DashboardParent
GetParent implements DashboardTreeRun
func (*DashboardExecutionTree) GetResource ¶
func (*DashboardExecutionTree) GetResource() resources.DashboardLeafNode
func (*DashboardExecutionTree) GetRunStatus ¶
func (e *DashboardExecutionTree) GetRunStatus() dashboardtypes.RunStatus
GetRunStatus returns the stats of the Root run
func (*DashboardExecutionTree) GetTitle ¶
func (e *DashboardExecutionTree) GetTitle() string
func (*DashboardExecutionTree) Initialise ¶
func (e *DashboardExecutionTree) Initialise(ctx context.Context)
func (*DashboardExecutionTree) InputRuntimeDependencies ¶
func (e *DashboardExecutionTree) InputRuntimeDependencies() []string
InputRuntimeDependencies returns the names of all inputs which are runtime dependencies
func (*DashboardExecutionTree) RunComplete ¶
func (e *DashboardExecutionTree) RunComplete() bool
func (*DashboardExecutionTree) SetComplete ¶
func (e *DashboardExecutionTree) SetComplete(ctx context.Context)
func (*DashboardExecutionTree) SetError ¶
func (e *DashboardExecutionTree) SetError(ctx context.Context, err error)
SetError sets the error on the Root run
func (*DashboardExecutionTree) SetInputValues ¶
func (e *DashboardExecutionTree) SetInputValues(inputValues *InputValues)
type DashboardExecutor ¶
type DashboardExecutor struct {
// contains filtered or unexported fields
}
var Executor *DashboardExecutor
func NewDashboardExecutor ¶
func NewDashboardExecutor(defaultClient *db_client.ClientMap) *DashboardExecutor
func (*DashboardExecutor) CancelExecutionForSession ¶
func (e *DashboardExecutor) CancelExecutionForSession(_ context.Context, sessionId string)
func (*DashboardExecutor) ExecuteDashboard ¶
func (e *DashboardExecutor) ExecuteDashboard(ctx context.Context, sessionId string, rootResource modconfig.ModTreeItem, inputs *InputValues, workspace *workspace.PowerpipeWorkspace, opts ...backend.BackendOption) (err error)
func (*DashboardExecutor) LoadSnapshot ¶
func (e *DashboardExecutor) LoadSnapshot(ctx context.Context, sessionId, snapshotName string, w *workspace.PowerpipeWorkspace) (map[string]any, error)
func (*DashboardExecutor) OnInputChanged ¶
func (e *DashboardExecutor) OnInputChanged(ctx context.Context, sessionId string, inputs *InputValues, changedInput string) error
type DashboardParentImpl ¶
type DashboardParentImpl struct { DashboardTreeRunImpl // contains filtered or unexported fields }
func (*DashboardParentImpl) ChildCompleteChan ¶
func (r *DashboardParentImpl) ChildCompleteChan() chan dashboardtypes.DashboardTreeRun
func (*DashboardParentImpl) ChildStatusChanged ¶
func (r *DashboardParentImpl) ChildStatusChanged(ctx context.Context)
func (*DashboardParentImpl) ChildrenComplete ¶
func (r *DashboardParentImpl) ChildrenComplete() bool
ChildrenComplete implements DashboardTreeRun
func (*DashboardParentImpl) GetChildren ¶
func (r *DashboardParentImpl) GetChildren() []dashboardtypes.DashboardTreeRun
GetChildren implements DashboardTreeRun
type DashboardRun ¶
type DashboardRun struct {
// contains filtered or unexported fields
}
DashboardRun is a struct representing a container run
func NewDashboardRun ¶
func NewDashboardRun(dashboard *resources.Dashboard, parent dashboardtypes.DashboardParent, executionTree *DashboardExecutionTree) (*DashboardRun, error)
func (*DashboardRun) AsTreeNode ¶
func (r *DashboardRun) AsTreeNode() *steampipeconfig.SnapshotTreeNode
func (*DashboardRun) Execute ¶
func (r *DashboardRun) Execute(ctx context.Context)
Execute implements DashboardTreeRun execute all children and wait for them to complete
func (*DashboardRun) GetInput ¶
func (r *DashboardRun) GetInput(name string) (*resources.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 dependency on the given input
func (*DashboardRun) GetWithRuns ¶
func (*DashboardRun) Initialise ¶
func (r *DashboardRun) Initialise(ctx context.Context)
Initialise implements DashboardTreeRun
func (*DashboardRun) IsSnapshotPanel ¶
func (*DashboardRun) IsSnapshotPanel()
IsSnapshotPanel implements SnapshotPanel
func (*DashboardRun) ProvidesRuntimeDependency ¶
func (p *DashboardRun) ProvidesRuntimeDependency(dependency *resources.RuntimeDependency) bool
func (*DashboardRun) PublishRuntimeDependencyValue ¶
func (p *DashboardRun) PublishRuntimeDependencyValue(name string, result *dashboardtypes.ResolvedRuntimeDependencyValue)
func (*DashboardRun) SubscribeToRuntimeDependency ¶
func (p *DashboardRun) SubscribeToRuntimeDependency(name string, opts ...RuntimeDependencyPublishOption) chan *dashboardtypes.ResolvedRuntimeDependencyValue
type DashboardTreeRunImpl ¶
type DashboardTreeRunImpl struct { DashboardName string `json:"dashboard"` Description string `json:"description,omitempty"` Display string `cty:"display" hcl:"display" json:"display,omitempty"` Documentation string `json:"documentation,omitempty"` ErrorString string `json:"error,omitempty"` Name string `json:"name"` NodeType string `json:"panel_type"` SourceDefinition string `json:"source_definition"` Status dashboardtypes.RunStatus `json:"status"` Tags map[string]string `json:"tags,omitempty"` Title string `json:"title,omitempty"` Type string `json:"display_type,omitempty"` Width int `json:"width,omitempty"` // contains filtered or unexported fields }
func NewDashboardTreeRunImpl ¶
func NewDashboardTreeRunImpl(resource resources.DashboardLeafNode, parent dashboardtypes.DashboardParent, run dashboardtypes.DashboardTreeRun, executionTree *DashboardExecutionTree) DashboardTreeRunImpl
func (*DashboardTreeRunImpl) AsTreeNode ¶
func (r *DashboardTreeRunImpl) AsTreeNode() *steampipeconfig.SnapshotTreeNode
AsTreeNode implements DashboardTreeRun
func (*DashboardTreeRunImpl) Execute ¶
func (r *DashboardTreeRunImpl) Execute(ctx context.Context)
Execute implements DashboardTreeRun
func (*DashboardTreeRunImpl) GetError ¶
func (r *DashboardTreeRunImpl) GetError() error
GetError implements DashboardTreeRun
func (*DashboardTreeRunImpl) GetInputsDependingOn ¶
func (r *DashboardTreeRunImpl) GetInputsDependingOn(_ string) []string
GetInputsDependingOn implements DashboardTreeRun defaults to nothing
func (*DashboardTreeRunImpl) GetName ¶
func (r *DashboardTreeRunImpl) GetName() string
GetName implements DashboardTreeRun
func (*DashboardTreeRunImpl) GetNodeType ¶
func (r *DashboardTreeRunImpl) GetNodeType() string
GetNodeType implements DashboardTreeRun
func (*DashboardTreeRunImpl) GetParent ¶
func (r *DashboardTreeRunImpl) GetParent() dashboardtypes.DashboardParent
GetParent implements DashboardTreeRun
func (*DashboardTreeRunImpl) GetResource ¶
func (r *DashboardTreeRunImpl) GetResource() resources.DashboardLeafNode
GetResource implements DashboardTreeRun
func (*DashboardTreeRunImpl) GetRunStatus ¶
func (r *DashboardTreeRunImpl) GetRunStatus() dashboardtypes.RunStatus
GetRunStatus implements DashboardTreeRun
func (*DashboardTreeRunImpl) GetTitle ¶
func (r *DashboardTreeRunImpl) GetTitle() string
GetTitle implements DashboardTreeRun
func (*DashboardTreeRunImpl) Initialise ¶
func (r *DashboardTreeRunImpl) Initialise(context.Context)
Initialise implements DashboardTreeRun
func (*DashboardTreeRunImpl) RunComplete ¶
func (r *DashboardTreeRunImpl) RunComplete() bool
RunComplete implements DashboardTreeRun
func (*DashboardTreeRunImpl) SetComplete ¶
func (r *DashboardTreeRunImpl) SetComplete(ctx context.Context)
SetComplete implements DashboardTreeRun
type DetectionBenchmarkDisplay ¶ added in v1.2.0
type DetectionBenchmarkDisplay struct { GroupId string `json:"name" csv:"group_id"` Title string `json:"title,omitempty" csv:"title"` Description string `json:"description,omitempty" csv:"description"` Tags map[string]string `json:"tags,omitempty"` Documentation string `json:"documentation,omitempty"` Display string `json:"display,omitempty"` Type string `json:"type,omitempty"` // the overall summary of the group Summary *DetectionBenchmarkSummary `json:"summary"` // child result groups Groups []*DetectionBenchmarkDisplay `json:"groups"` // child runs DetectionRuns []*DetectionRun `json:"detection_runs"` // list of children stored as controlexecute.ExecutionTreeNode Children []controlexecute.ExecutionTreeNode `json:"-"` Severity map[string]controlstatus.StatusSummary `json:"-"` // "benchmark" NodeType string `json:"panel_type"` // the control tree item associated with this group(i.e. a mod/benchmark) GroupItem modconfig.ModTreeItem `json:"-"` Parent *DetectionBenchmarkDisplay `json:"-"` Duration time.Duration `json:"-"` // a list of distinct dimension keys from descendant controls DimensionKeys []string `json:"-"` // contains filtered or unexported fields }
func NewDetectionBenchmarkDisplay ¶ added in v1.2.0
func NewDetectionBenchmarkDisplay(benchmarkRun *DetectionBenchmarkRun, parent *DetectionBenchmarkDisplay) (*DetectionBenchmarkDisplay, error)
NewDetectionBenchmarkDisplay creates a result group from a ModTreeItem
func NewRootBenchmarkDisplay ¶ added in v1.2.0
func NewRootBenchmarkDisplay(rootItem modconfig.ModTreeItem) (*DetectionBenchmarkDisplay, error)
NewRootBenchmarkDisplay creates a DetectionBenchmarkDisplay to act as the root node of a control execution tree
func (*DetectionBenchmarkDisplay) AddDetection ¶ added in v1.2.0
func (r *DetectionBenchmarkDisplay) AddDetection(detectionRun *DetectionRun)
AddDetection add run into our list, and also add a tree node into our child list
func (*DetectionBenchmarkDisplay) AddResultGroup ¶ added in v1.2.0
func (r *DetectionBenchmarkDisplay) AddResultGroup(group *DetectionBenchmarkDisplay)
AddResultGroup adds result group into our list, and also add a tree node into our child list
func (*DetectionBenchmarkDisplay) AllTagKeys ¶ added in v1.2.0
func (r *DetectionBenchmarkDisplay) AllTagKeys() []string
func (*DetectionBenchmarkDisplay) AsTreeNode ¶ added in v1.2.0
func (r *DetectionBenchmarkDisplay) AsTreeNode() *steampipeconfig.SnapshotTreeNode
AsTreeNode implements ExecutionTreeNode
func (*DetectionBenchmarkDisplay) GetChildGroupByName ¶ added in v1.2.0
func (r *DetectionBenchmarkDisplay) GetChildGroupByName(name string) *DetectionBenchmarkDisplay
GetChildGroupByName finds a nested child DetectionBenchmarkDisplay with a specific name
func (*DetectionBenchmarkDisplay) GetChildren ¶ added in v1.2.0
func (r *DetectionBenchmarkDisplay) GetChildren() []controlexecute.ExecutionTreeNode
GetChildren implements ExecutionTreeNode
func (*DetectionBenchmarkDisplay) GetGroupByName ¶ added in v1.2.0
func (r *DetectionBenchmarkDisplay) GetGroupByName(name string) *DetectionBenchmarkDisplay
GetGroupByName finds an immediate child DetectionBenchmarkDisplay with a specific name
func (*DetectionBenchmarkDisplay) GetName ¶ added in v1.2.0
func (r *DetectionBenchmarkDisplay) GetName() string
GetName implements ExecutionTreeNode
func (*DetectionBenchmarkDisplay) GetRunByName ¶ added in v1.2.0
func (r *DetectionBenchmarkDisplay) GetRunByName(name string) *DetectionRun
GetRunByName finds a child ControlRun with a specific control name
func (*DetectionBenchmarkDisplay) GetSummary ¶ added in v1.2.0
func (r *DetectionBenchmarkDisplay) GetSummary() *DetectionBenchmarkSummary
func (*DetectionBenchmarkDisplay) IsExecutionTreeNode ¶ added in v1.2.0
func (*DetectionBenchmarkDisplay) IsExecutionTreeNode()
IsExecutionTreeNode implements ExecutionTreeNode
func (*DetectionBenchmarkDisplay) IsSnapshotPanel ¶ added in v1.2.0
func (*DetectionBenchmarkDisplay) IsSnapshotPanel()
IsSnapshotPanel implements SnapshotPanel
func (*DetectionBenchmarkDisplay) RunCount ¶ added in v1.2.0
func (r *DetectionBenchmarkDisplay) RunCount() int
func (*DetectionBenchmarkDisplay) SetSummary ¶ added in v1.2.0
func (r *DetectionBenchmarkDisplay) SetSummary()
SetSummary populates the summary (which just counts the number of detections)
type DetectionBenchmarkDisplayTree ¶ added in v1.2.0
type DetectionBenchmarkDisplayTree struct { Root *DetectionBenchmarkDisplay `json:"root"` // map of all leaf runs, keyed by FULL name LeafRuns map[string]controlexecute.LeafRun `json:"-"` StartTime time.Time `json:"start_time"` EndTime time.Time `json:"end_time"` Progress *controlstatus.ControlProgress `json:"progress"` // map of dimension property name to property value to color map DimensionColorGenerator *controlexecute.DimensionColorGenerator `json:"-"` Workspace *workspace.PowerpipeWorkspace `json:"-"` // for now just using DetectionRuns DetectionRuns []*DetectionRun `json:"-"` }
DetectionBenchmarkDisplayTree is a structure representing the control execution hierarchy
func (*DetectionBenchmarkDisplayTree) IsExportSourceData ¶ added in v1.2.0
func (*DetectionBenchmarkDisplayTree) IsExportSourceData()
IsExportSourceData implements ExportSourceData
type DetectionBenchmarkRun ¶ added in v1.2.0
type DetectionBenchmarkRun struct { DashboardParentImpl BenchmarkType string `json:"benchmark_type"` // contains filtered or unexported fields }
func NewDetectionBenchmarkRun ¶ added in v1.2.0
func NewDetectionBenchmarkRun(container *resources.DetectionBenchmark, parent dashboardtypes.DashboardParent, executionTree *DashboardExecutionTree) (*DetectionBenchmarkRun, error)
func (*DetectionBenchmarkRun) AsTreeNode ¶ added in v1.2.0
func (r *DetectionBenchmarkRun) AsTreeNode() *steampipeconfig.SnapshotTreeNode
func (*DetectionBenchmarkRun) Execute ¶ added in v1.2.0
func (r *DetectionBenchmarkRun) Execute(ctx context.Context)
Execute implements DashboardTreeRun execute all children and wait for them to complete
func (*DetectionBenchmarkRun) Initialise ¶ added in v1.2.0
func (r *DetectionBenchmarkRun) Initialise(ctx context.Context)
Initialise implements DashboardTreeRun
func (*DetectionBenchmarkRun) IsSnapshotPanel ¶ added in v1.2.0
func (*DetectionBenchmarkRun) IsSnapshotPanel()
IsSnapshotPanel implements SnapshotPanel
type DetectionBenchmarkSummary ¶ added in v1.2.0
type DetectionBenchmarkSummary struct {
Count int `json:"count"`
}
func NewDetectionBenchmarkSummary ¶ added in v1.2.0
func NewDetectionBenchmarkSummary() *DetectionBenchmarkSummary
type DetectionRun ¶ added in v1.2.0
type DetectionRun struct { // all RuntimeDependencySubscribers are also publishers as they have args/params RuntimeDependencySubscriberImpl Resource *resources.Detection `json:"-"` // this is populated by retrieving Resource properties with the snapshot tag Properties map[string]any `json:"properties,omitempty"` Data *dashboardtypes.LeafData `json:"data,omitempty"` Documentation string `json:"documentation,omitempty"` // contains filtered or unexported fields }
DetectionRun is a struct representing the execution of a leaf dashboard node
func NewDetectionRun ¶ added in v1.2.0
func NewDetectionRun(resource *resources.Detection, parent dashboardtypes.DashboardParent, executionTree *DashboardExecutionTree) (*DetectionRun, error)
func (*DetectionRun) AsTreeNode ¶ added in v1.2.0
func (r *DetectionRun) AsTreeNode() *steampipeconfig.SnapshotTreeNode
func (*DetectionRun) Execute ¶ added in v1.2.0
func (r *DetectionRun) Execute(ctx context.Context)
Execute implements DashboardTreeRun
func (*DetectionRun) GetChildren ¶ added in v1.2.0
func (r *DetectionRun) GetChildren() []controlexecute.ExecutionTreeNode
func (*DetectionRun) GetWithRuns ¶ added in v1.2.0
func (*DetectionRun) Initialise ¶ added in v1.2.0
func (*DetectionRun) IsExecutionTreeNode ¶ added in v1.2.0
func (r *DetectionRun) IsExecutionTreeNode()
func (*DetectionRun) IsSnapshotPanel ¶ added in v1.2.0
func (*DetectionRun) IsSnapshotPanel()
IsSnapshotPanel implements SnapshotPanel
func (*DetectionRun) ProvidesRuntimeDependency ¶ added in v1.2.0
func (p *DetectionRun) ProvidesRuntimeDependency(dependency *resources.RuntimeDependency) bool
func (*DetectionRun) PublishRuntimeDependencyValue ¶ added in v1.2.0
func (p *DetectionRun) PublishRuntimeDependencyValue(name string, result *dashboardtypes.ResolvedRuntimeDependencyValue)
func (*DetectionRun) SetComplete ¶ added in v1.2.0
func (r *DetectionRun) SetComplete(ctx context.Context)
SetComplete implements DashboardTreeRun (override to set snapshothook status
func (*DetectionRun) SetError ¶ added in v1.2.0
func (r *DetectionRun) SetError(ctx context.Context, err error)
SetError implements DashboardTreeRun (override to set snapshothook status)
func (*DetectionRun) SubscribeToRuntimeDependency ¶ added in v1.2.0
func (p *DetectionRun) SubscribeToRuntimeDependency(name string, opts ...RuntimeDependencyPublishOption) chan *dashboardtypes.ResolvedRuntimeDependencyValue
type InputValues ¶ added in v1.2.0
type InputValues struct { Inputs map[string]interface{} `json:"inputs"` // map of time ranges, keyed by target benchmark/detection DateTimeRange utils.TimeRange `json:"detection_time_ranges"` }
func NewInputValues ¶ added in v1.2.0
func NewInputValues() *InputValues
func (*InputValues) Empty ¶ added in v1.2.0
func (v *InputValues) Empty() bool
type LeafRun ¶
type LeafRun struct { // all RuntimeDependencySubscribers are also publishers as they have args/params RuntimeDependencySubscriberImpl Resource resources.DashboardLeafNode `json:"-"` // this is populated by retrieving Resource properties with the snapshot tag Properties map[string]any `json:"properties,omitempty"` Data *dashboardtypes.LeafData `json:"data,omitempty"` Documentation string `json:"documentation,omitempty"` // contains filtered or unexported fields }
LeafRun is a struct representing the execution of a leaf dashboard node
func NewLeafRun ¶
func NewLeafRun(resource resources.DashboardLeafNode, parent dashboardtypes.DashboardParent, executionTree *DashboardExecutionTree, opts ...LeafRunOption) (*LeafRun, error)
func (*LeafRun) AsTreeNode ¶
func (r *LeafRun) AsTreeNode() *steampipeconfig.SnapshotTreeNode
func (*LeafRun) GetWithRuns ¶
func (*LeafRun) Initialise ¶
func (*LeafRun) IsSnapshotPanel ¶
func (*LeafRun) IsSnapshotPanel()
IsSnapshotPanel implements SnapshotPanel
func (*LeafRun) ProvidesRuntimeDependency ¶
func (p *LeafRun) ProvidesRuntimeDependency(dependency *resources.RuntimeDependency) bool
func (*LeafRun) PublishRuntimeDependencyValue ¶
func (p *LeafRun) PublishRuntimeDependencyValue(name string, result *dashboardtypes.ResolvedRuntimeDependencyValue)
func (*LeafRun) SetComplete ¶
SetComplete implements DashboardTreeRun (override to set snapshothook status
func (*LeafRun) SetError ¶
SetError implements DashboardTreeRun (override to set snapshothook status)
func (*LeafRun) SubscribeToRuntimeDependency ¶
func (p *LeafRun) SubscribeToRuntimeDependency(name string, opts ...RuntimeDependencyPublishOption) chan *dashboardtypes.ResolvedRuntimeDependencyValue
type LeafRunOption ¶
type LeafRunOption = func(target *LeafRun)
type RuntimeDependencyPublishOption ¶
type RuntimeDependencyPublishOption = func(target *RuntimeDependencyPublishTarget)
func WithTransform ¶
func WithTransform(transform func(*dashboardtypes.ResolvedRuntimeDependencyValue) *dashboardtypes.ResolvedRuntimeDependencyValue) RuntimeDependencyPublishOption
type RuntimeDependencyPublishTarget ¶
type RuntimeDependencyPublishTarget struct {
// contains filtered or unexported fields
}
type RuntimeDependencyPublisher ¶
type RuntimeDependencyPublisher interface { dashboardtypes.DashboardTreeRun ProvidesRuntimeDependency(dependency *resources.RuntimeDependency) bool SubscribeToRuntimeDependency(name string, opts ...RuntimeDependencyPublishOption) chan *dashboardtypes.ResolvedRuntimeDependencyValue PublishRuntimeDependencyValue(name string, result *dashboardtypes.ResolvedRuntimeDependencyValue) GetWithRuns() map[string]*LeafRun }
type RuntimeDependencySubscriber ¶
type RuntimeDependencySubscriber interface { RuntimeDependencyPublisher GetBaseDependencySubscriber() RuntimeDependencySubscriber }
type RuntimeDependencySubscriberImpl ¶
type RuntimeDependencySubscriberImpl struct { RawSQL string `json:"sql,omitempty"` // a list of the (scoped) names of any runtime dependencies that we rely on RuntimeDependencyNames []string `json:"dependencies,omitempty"` // contains filtered or unexported fields }
func NewRuntimeDependencySubscriber ¶
func NewRuntimeDependencySubscriber(resource resources.DashboardLeafNode, parent dashboardtypes.DashboardParent, run dashboardtypes.DashboardTreeRun, executionTree *DashboardExecutionTree) *RuntimeDependencySubscriberImpl
func (*RuntimeDependencySubscriberImpl) AsTreeNode ¶
func (p *RuntimeDependencySubscriberImpl) AsTreeNode() *steampipeconfig.SnapshotTreeNode
func (*RuntimeDependencySubscriberImpl) GetBaseDependencySubscriber ¶
func (s *RuntimeDependencySubscriberImpl) GetBaseDependencySubscriber() RuntimeDependencySubscriber
GetBaseDependencySubscriber implements RuntimeDependencySubscriber
func (*RuntimeDependencySubscriberImpl) GetName ¶
func (p *RuntimeDependencySubscriberImpl) GetName() string
func (*RuntimeDependencySubscriberImpl) GetWithRuns ¶
func (*RuntimeDependencySubscriberImpl) Initialise ¶
func (*RuntimeDependencySubscriberImpl) ProvidesRuntimeDependency ¶
func (p *RuntimeDependencySubscriberImpl) ProvidesRuntimeDependency(dependency *resources.RuntimeDependency) bool
func (*RuntimeDependencySubscriberImpl) PublishRuntimeDependencyValue ¶
func (p *RuntimeDependencySubscriberImpl) PublishRuntimeDependencyValue(name string, result *dashboardtypes.ResolvedRuntimeDependencyValue)
func (*RuntimeDependencySubscriberImpl) SubscribeToRuntimeDependency ¶
func (p *RuntimeDependencySubscriberImpl) SubscribeToRuntimeDependency(name string, opts ...RuntimeDependencyPublishOption) chan *dashboardtypes.ResolvedRuntimeDependencyValue
type SummaryProvider ¶ added in v1.2.0
type SummaryProvider interface { SetSummary() GetSummary() *DetectionBenchmarkSummary }
Source Files ¶
- check_run.go
- container_run.go
- control_hooks_dashboard_event.go
- dashboard_execution_tree.go
- dashboard_parent_impl.go
- dashboard_run.go
- dashboard_tree_run_impl.go
- detection_benchmark_display.go
- detection_benchmark_display_tree.go
- detection_benchmark_run.go
- detection_run.go
- executor.go
- input_values.go
- leaf_run.go
- leaf_run_option.go
- referenced_variables.go
- runtime_dependency_publisher.go
- runtime_dependency_publisher_impl.go
- runtime_dependency_publisher_option.go
- runtime_dependency_publisher_target.go
- runtime_dependency_subscriber.go
- runtime_dependency_subscriber_impl.go
- snapshot.go