dashboardexecute

package
v0.17.0-alpha.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2022 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Executor = newDashboardExecutor()

Functions

This section is empty.

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"`
	SessionId        string            `json:"session_id"`

	Summary *controlexecute.GroupSummary `json:"summary"`
	// if the dashboard node is a control, serialise to json as 'properties'
	Control       *modconfig.Control          `json:"properties,omitempty"`
	DashboardNode modconfig.DashboardLeafNode `json:"-"`
	// contains filtered or unexported fields
}

CheckRun is a struct representing the execution of a control or benchmark

func (*CheckRun) AsTreeNode

func (r *CheckRun) AsTreeNode() *dashboardtypes.SnapshotTreeNode

func (*CheckRun) ChildrenComplete

func (r *CheckRun) ChildrenComplete() bool

ChildrenComplete implements DashboardNodeRun

func (*CheckRun) Execute

func (r *CheckRun) Execute(ctx context.Context)

Execute implements DashboardRunNode

func (*CheckRun) GetChildren

func (r *CheckRun) GetChildren() []dashboardtypes.DashboardNodeRun

GetChildren implements DashboardNodeRun

func (*CheckRun) GetError

func (r *CheckRun) GetError() error

GetError implements DashboardNodeRun

func (*CheckRun) GetInputsDependingOn

func (r *CheckRun) GetInputsDependingOn(changedInputName string) []string

GetInputsDependingOn implements DashboardNodeRun return nothing for CheckRun

func (*CheckRun) GetName

func (r *CheckRun) GetName() string

GetName implements DashboardNodeRun

func (*CheckRun) GetRunStatus

func (r *CheckRun) GetRunStatus() dashboardtypes.DashboardRunStatus

GetRunStatus implements DashboardNodeRun

func (*CheckRun) Initialise

func (r *CheckRun) Initialise(ctx context.Context)

Initialise implements DashboardRunNode

func (*CheckRun) IsSnapshotPanel

func (*CheckRun) IsSnapshotPanel()

IsSnapshotPanel implements SnapshotPanel

func (*CheckRun) RunComplete

func (r *CheckRun) RunComplete() bool

RunComplete implements DashboardNodeRun

func (*CheckRun) SetComplete

func (r *CheckRun) SetComplete()

SetComplete implements DashboardNodeRun

func (*CheckRun) SetError

func (r *CheckRun) SetError(err error)

SetError implements DashboardNodeRun

type ControlEventHooks

type ControlEventHooks struct {
	CheckRun *CheckRun
}

ControlEventHooks is a struct which implements ControlHooks, and displays the control progress as a status message

func NewControlEventHooks

func NewControlEventHooks(r *CheckRun) *ControlEventHooks

func (*ControlEventHooks) OnComplete

func (*ControlEventHooks) OnControlComplete

func (c *ControlEventHooks) OnControlComplete(ctx context.Context, controlRun controlstatus.ControlRunStatusProvider, progress *controlstatus.ControlProgress)

func (*ControlEventHooks) OnControlError

func (*ControlEventHooks) OnStart

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"`
	Children         []dashboardtypes.DashboardNodeRun `json:"-"`
	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 (*DashboardContainerRun) AsTreeNode

func (*DashboardContainerRun) ChildCompleteChan

func (r *DashboardContainerRun) ChildCompleteChan() chan dashboardtypes.DashboardNodeRun

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

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

GetRunStatus 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()

SetComplete implements DashboardNodeRun

func (*DashboardContainerRun) SetError

func (r *DashboardContainerRun) SetError(err error)

SetError implements DashboardNodeRun tell parent we are done

type DashboardExecutionTree

type DashboardExecutionTree struct {
	Root dashboardtypes.DashboardNodeRun
	// contains filtered or unexported fields
}

DashboardExecutionTree is a structure representing the control result hierarchy

func NewDashboardExecutionTree

func NewDashboardExecutionTree(rootName string, sessionId string, client db_common.Client, workspace *workspace.Workspace) (*DashboardExecutionTree, error)

NewDashboardExecutionTree creates a result group from a ModTreeItem

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

GetRunStatus returns the stats of the Root run

func (*DashboardExecutionTree) SetError

func (e *DashboardExecutionTree) SetError(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 (e *DashboardExecutor) ExecuteDashboard(ctx context.Context, sessionId, dashboardName string, inputs map[string]interface{}, workspace *workspace.Workspace, client db_common.Client) (err error)

func (*DashboardExecutor) OnInputChanged

func (e *DashboardExecutor) OnInputChanged(ctx context.Context, sessionId string, inputs map[string]interface{}, changedInput string) error

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"`
	Children         []dashboardtypes.DashboardNodeRun `json:"-"`
	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

GetRunStatus 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()

SetComplete implements DashboardNodeRun

func (*DashboardRun) SetError

func (r *DashboardRun) SetError(err error)

SetError implements DashboardNodeRun tell parent we are done

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"`
	// contains filtered or unexported fields
}

LeafRun is a struct representing the execution of a leaf dashboard node

func (*LeafRun) AsTreeNode

func (r *LeafRun) AsTreeNode() *dashboardtypes.SnapshotTreeNode

func (*LeafRun) ChildrenComplete

func (r *LeafRun) ChildrenComplete() bool

ChildrenComplete implements DashboardNodeRun

func (*LeafRun) Execute

func (r *LeafRun) Execute(ctx context.Context)

Execute implements DashboardRunNode

func (*LeafRun) GetChildren

func (r *LeafRun) GetChildren() []dashboardtypes.DashboardNodeRun

GetChildren implements DashboardNodeRun

func (*LeafRun) GetError

func (r *LeafRun) GetError() error

GetError implements DashboardNodeRun

func (*LeafRun) GetInputsDependingOn

func (r *LeafRun) GetInputsDependingOn(changedInputName string) []string

GetInputsDependingOn implements DashboardNodeRun return nothing for LeafRun

func (*LeafRun) GetName

func (r *LeafRun) GetName() string

GetName implements DashboardNodeRun

func (*LeafRun) GetRunStatus

func (r *LeafRun) GetRunStatus() dashboardtypes.DashboardRunStatus

GetRunStatus implements DashboardNodeRun

func (*LeafRun) Initialise

func (r *LeafRun) Initialise(ctx context.Context)

Initialise implements DashboardRunNode

func (*LeafRun) IsSnapshotPanel

func (*LeafRun) IsSnapshotPanel()

IsSnapshotPanel implements SnapshotPanel

func (*LeafRun) RunComplete

func (r *LeafRun) RunComplete() bool

RunComplete implements DashboardNodeRun

func (*LeafRun) SetComplete

func (r *LeafRun) SetComplete()

SetComplete implements DashboardNodeRun

func (*LeafRun) SetError

func (r *LeafRun) SetError(err error)

SetError 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL