modconfig

package
v0.19.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: AGPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockTypeMod            = "mod"
	BlockTypeQuery          = "query"
	BlockTypeControl        = "control"
	BlockTypeBenchmark      = "benchmark"
	BlockTypeDashboard      = "dashboard"
	BlockTypeContainer      = "container"
	BlockTypeChart          = "chart"
	BlockTypeCard           = "card"
	BlockTypeFlow           = "flow"
	BlockTypeGraph          = "graph"
	BlockTypeHierarchy      = "hierarchy"
	BlockTypeImage          = "image"
	BlockTypeInput          = "input"
	BlockTypeTable          = "table"
	BlockTypeText           = "text"
	BlockTypeLocals         = "locals"
	BlockTypeVariable       = "variable"
	BlockTypeParam          = "param"
	BlockTypeRequire        = "require"
	BlockTypeNode           = "node"
	BlockTypeEdge           = "edge"
	BlockTypeLegacyRequires = "requires"
	BlockTypeCategory       = "category"
	BlockTypeWith           = "with"

	// config blocks
	BlockTypeConnection       = "connection"
	BlockTypeOptions          = "options"
	BlockTypeWorkspaceProfile = "workspace"

	ResourceTypeSnapshot = "snapshot"
	AttributeArgs        = "args"
	AttributeQuery       = "query"
)

NOTE: when adding a block type, be sure to update QueryProviderBlocks/ReferenceBlocks/AllBlockTypes as needed

View Source
const (
	ConnectionTypeAggregator = "aggregator"
)
View Source
const RuntimeDependencyDashboardScope = "self"
View Source
const SnapshotQueryTableName = "custom.table.results"

Variables

View Source
var NodeAndEdgeProviderBlocks = []string{
	BlockTypeHierarchy,
	BlockTypeFlow,
	BlockTypeGraph,
}

NodeAndEdgeProviderBlocks is a list of block types which implementnodeAndEdgeProvider

QueryProviderBlocks is a list of block types which implement QueryProvider

ReferenceBlocks is a list of block types we store references for

View Source
var ResourceTypeMap = map[string]factoryFunc{
	constants.SqlExtension: func(modPath, filePath string, mod *Mod) (MappableResource, []byte, error) {
		return QueryFromFile(modPath, filePath, mod)
	},
}

Functions

func BuildFullResourceName added in v0.17.0

func BuildFullResourceName(mod, blockType, name string) string

func BuildModResourceName

func BuildModResourceName(blockType, name string) string

func GetCtyTypes

func GetCtyTypes(item interface{}) map[string]cty.Type

GetCtyTypes builds a map of cty types for all tagged properties. It is used to convert the struct to a cty value

func GetCtyValue added in v0.19.0

func GetCtyValue(item interface{}) (cty.Value, error)

GetCtyValue converts the item into a cty value

func GetMonotonicVersionString

func GetMonotonicVersionString(v *semver.Version) string

func IsValidResourceItemType added in v0.17.0

func IsValidResourceItemType(blockType string) bool

func ModVersionFullName

func ModVersionFullName(name string, version *semver.Version) string

func ParseModFullName

func ParseModFullName(fullName string) (modName string, modVersion *semver.Version, err error)

func PseudoResourceNameFromPath

func PseudoResourceNameFromPath(modPath, filePath string) (string, error)

PseudoResourceNameFromPath converts a filepath into a resource name

It operates as follows:

  1. get filename
  2. remove extension
  3. sluggify, with '_' as the divider

func RegisteredFileExtensions

func RegisteredFileExtensions() []string

func ResolveArgs added in v0.19.0

func ResolveArgs(qp QueryProvider, runtimeArgs *QueryArgs) ([]any, error)

ResolveArgs resolves the argument values, falling back on defaults from param definitions in the source (if present) it returns the arg values as a csv string which can be used in a prepared statement invocation (the arg values and param defaults will already have been converted to postgres format)

func UnqualifiedResourceName

func UnqualifiedResourceName(fullName string) string

UnqualifiedResourceName removes the mod prefix from the given name

Types

type Benchmark

type Benchmark struct {
	ResourceWithMetadataImpl
	ModTreeItemImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	// child names as NamedItem structs - used to allow setting children via the 'children' property
	ChildNames NamedItemList `cty:"child_names" json:"-"`
	// used for introspection tables
	ChildNameStrings []string `cty:"child_name_strings" column:"children,jsonb" json:"-"`

	// dashboard specific properties
	Base    *Benchmark `hcl:"base" json:"-"`
	Width   *int       `cty:"width" hcl:"width" column:"width,text" json:"-"`
	Type    *string    `cty:"type" hcl:"type" column:"type,text" json:"-"`
	Display *string    `cty:"display" hcl:"display" json:"-"`
}

Benchmark is a struct representing the Benchmark resource

func (*Benchmark) CtyValue

func (b *Benchmark) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*Benchmark) Diff

func (b *Benchmark) Diff(other *Benchmark) *DashboardTreeItemDiffs

func (*Benchmark) Equals

func (b *Benchmark) Equals(other *Benchmark) bool

func (*Benchmark) GetChildControls

func (b *Benchmark) GetChildControls() []*Control

GetChildControls return a flat list of controls underneath the benchmark in the tree

func (*Benchmark) GetDisplay

func (b *Benchmark) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*Benchmark) GetType

func (b *Benchmark) GetType() string

GetType implements DashboardLeafNode

func (*Benchmark) GetUnqualifiedName

func (b *Benchmark) GetUnqualifiedName() string

GetUnqualifiedName implements DashboardLeafNode, ModTreeItem

func (*Benchmark) GetWidth

func (b *Benchmark) GetWidth() int

GetWidth implements DashboardLeafNode

func (*Benchmark) OnDecoded

func (b *Benchmark) OnDecoded(block *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

func (*Benchmark) SetChildren added in v0.19.0

func (b *Benchmark) SetChildren(children []ModTreeItem)

func (*Benchmark) String

func (b *Benchmark) String() string

func (*Benchmark) WalkResources added in v0.16.0

func (b *Benchmark) WalkResources(resourceFunc func(resource ModTreeItem) (bool, error)) error

type ConfigMap added in v0.17.0

type ConfigMap map[string]interface{}

func (ConfigMap) PopulateConfigMapForOptions added in v0.17.0

func (m ConfigMap) PopulateConfigMapForOptions(o options.Options)

PopulateConfigMapForOptions populates the config map for a given options object NOTE: this mutates configMap

func (ConfigMap) SetIntItem added in v0.17.0

func (m ConfigMap) SetIntItem(argValue *int, argName string)

SetIntItem checks is int pointer is non-nul and if so, add to map with given key

func (ConfigMap) SetStringItem added in v0.17.0

func (m ConfigMap) SetStringItem(argValue *string, argName string)

SetStringItem checks is string pointer is non-nul and if so, add to map with given key

type Connection

type Connection struct {
	// connection name
	Name string `json:"name,omitempty"`
	// The name of plugin as mentioned in config
	PluginShortName string `json:"plugin_short_name,omitempty"`
	// The fully qualified name of the plugin. derived from the short name
	Plugin string `json:"plugin,omitempty"`
	// Type - supported values: "aggregator"
	Type string `json:"type,omitempty"`
	// this is a list of names or wildcards which are resolved to connections
	// (only valid for "aggregator" type)
	ConnectionNames []string `json:"connections,omitempty"`
	// a map of the resolved child connections
	// (only valid for "aggregator" type)
	Connections map[string]*Connection `json:"-"`
	// a list of the names resolved child connections
	// (only valid for "aggregator" type)
	ResolvedConnectionNames []string `json:"resolved_connections,omitempty"`
	// unparsed HCL of plugin specific connection config
	Config string `json:"config,omitempty"`

	// options
	Options   *options.Connection `json:"options,omitempty"`
	DeclRange Range               `json:"decl_range,omitempty"`
}

Connection is a struct representing the partially parsed connection

(Partial as the connection config, which is plugin specific, is stored as raw HCL. This will be parsed by the plugin) json tags needed as this is stored in the connection state file

func NewConnection

func NewConnection(block *hcl.Block) *Connection

func (*Connection) Equals

func (c *Connection) Equals(other *Connection) bool

func (*Connection) GetResolveConnectionNames added in v0.16.0

func (c *Connection) GetResolveConnectionNames() []string

GetResolveConnectionNames return the names of all child connections (will only be non-empty for aggregator connections)

func (*Connection) PopulateChildren

func (c *Connection) PopulateChildren(connectionMap map[string]*Connection)

func (*Connection) SetOptions

func (c *Connection) SetOptions(opts options.Options, block *hcl.Block) hcl.Diagnostics

SetOptions sets the options on the connection verify the options object is a valid options type (only options.Connection currently supported)

func (*Connection) String

func (c *Connection) String() string

func (*Connection) Validate

func (c *Connection) Validate(map[string]*Connection) (warnings []string, errors []string)

Validate verifies the Type property is valid, if this is an aggregator connection, there must be at least one child, and no duplicates if this is NOT an aggregator, there must be no children

func (*Connection) ValidateAggregatorConnection

func (c *Connection) ValidateAggregatorConnection() (warnings, errors []string)

type Control

type Control struct {
	ResourceWithMetadataImpl
	QueryProviderImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	Severity *string `cty:"severity" hcl:"severity"  column:"severity,text" json:"severity,omitempty"`

	// dashboard specific properties
	Base    *Control `hcl:"base" json:"-"`
	Width   *int     `cty:"width" hcl:"width" column:"width,text" json:"-"`
	Type    *string  `cty:"type" hcl:"type" column:"type,text" json:"-"`
	Display *string  `cty:"display" hcl:"display" json:"-"`
	// contains filtered or unexported fields
}

Control is a struct representing the Control resource

func (*Control) CtyValue

func (c *Control) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*Control) Diff

func (c *Control) Diff(other *Control) *DashboardTreeItemDiffs

func (*Control) Equals

func (c *Control) Equals(other *Control) bool

func (*Control) GetDisplay

func (c *Control) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*Control) GetParentNames

func (c *Control) GetParentNames() []string

func (*Control) GetType

func (c *Control) GetType() string

GetType implements DashboardLeafNode

func (*Control) GetWidth

func (c *Control) GetWidth() int

GetWidth implements DashboardLeafNode

func (*Control) OnDecoded

func (c *Control) OnDecoded(block *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

func (*Control) String

func (c *Control) String() string

type CtyValueProvider added in v0.19.0

type CtyValueProvider interface {
	CtyValue() (cty.Value, error)
}

type Dashboard

type Dashboard struct {
	ResourceWithMetadataImpl
	ModTreeItemImpl
	WithProviderImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	Width   *int              `cty:"width" hcl:"width"  column:"width,text"`
	Display *string           `cty:"display" hcl:"display" column:"display,text"`
	Inputs  []*DashboardInput `cty:"inputs" column:"inputs,jsonb"`
	UrlPath string            `cty:"url_path"  column:"url_path,jsonb"`
	Base    *Dashboard        `hcl:"base"`
	// store children in a way which can be serialised via cty
	ChildNames []string `cty:"children" column:"children,jsonb"`
	// contains filtered or unexported fields
}

Dashboard is a struct representing the Dashboard resource

func NewQueryDashboard added in v0.17.0

func NewQueryDashboard(qp QueryProvider) (*Dashboard, error)

NewQueryDashboard creates a dashboard to wrap a query/control this is used for snapshot generation

func (*Dashboard) AddChild

func (d *Dashboard) AddChild(child ModTreeItem)

func (*Dashboard) CtyValue

func (d *Dashboard) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*Dashboard) Diff

func (d *Dashboard) Diff(other *Dashboard) *DashboardTreeItemDiffs

func (*Dashboard) Equals

func (d *Dashboard) Equals(other *Dashboard) bool

func (*Dashboard) GetDisplay added in v0.19.0

func (d *Dashboard) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*Dashboard) GetInput

func (d *Dashboard) GetInput(name string) (*DashboardInput, bool)

func (*Dashboard) GetInputs added in v0.19.0

func (d *Dashboard) GetInputs() map[string]*DashboardInput

func (*Dashboard) GetType added in v0.19.0

func (d *Dashboard) GetType() string

GetType implements DashboardLeafNode

func (*Dashboard) GetWidth added in v0.19.0

func (d *Dashboard) GetWidth() int

GetWidth implements DashboardLeafNode

func (*Dashboard) InitInputs added in v0.19.0

func (d *Dashboard) InitInputs() hcl.Diagnostics

func (*Dashboard) OnDecoded

func (d *Dashboard) OnDecoded(block *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

func (*Dashboard) SetChildren

func (d *Dashboard) SetChildren(children []ModTreeItem)

func (*Dashboard) ValidateRuntimeDependencies added in v0.19.0

func (d *Dashboard) ValidateRuntimeDependencies(workspace ResourceMapsProvider) error

func (*Dashboard) WalkResources

func (d *Dashboard) WalkResources(resourceFunc func(resource HclResource) (bool, error)) error

type DashboardCard

type DashboardCard struct {
	ResourceWithMetadataImpl
	QueryProviderImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	Label *string `cty:"label" hcl:"label" column:"label,text" json:"label,omitempty"`
	Value *string `cty:"value" hcl:"value" column:"value,text" json:"value,omitempty"`
	Icon  *string `cty:"icon" hcl:"icon" column:"icon,text" json:"icon,omitempty"`
	HREF  *string `cty:"href" hcl:"href" json:"href,omitempty"`

	Width   *int           `cty:"width" hcl:"width" column:"width,text" json:"-"`
	Type    *string        `cty:"type" hcl:"type" column:"type,text" json:"-"`
	Display *string        `cty:"display" hcl:"display" json:"-"`
	Base    *DashboardCard `hcl:"base" json:"-"`
	// contains filtered or unexported fields
}

DashboardCard is a struct representing a leaf dashboard node

func (*DashboardCard) CtyValue

func (c *DashboardCard) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*DashboardCard) Diff

func (*DashboardCard) Equals

func (c *DashboardCard) Equals(other *DashboardCard) bool

func (*DashboardCard) GetDisplay

func (c *DashboardCard) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*DashboardCard) GetDocumentation

func (c *DashboardCard) GetDocumentation() string

GetDocumentation implements DashboardLeafNode, ModTreeItem

func (*DashboardCard) GetType

func (c *DashboardCard) GetType() string

GetType implements DashboardLeafNode

func (*DashboardCard) GetWidth

func (c *DashboardCard) GetWidth() int

GetWidth implements DashboardLeafNode

func (*DashboardCard) OnDecoded

func (c *DashboardCard) OnDecoded(block *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

func (*DashboardCard) ValidateQuery added in v0.19.0

func (c *DashboardCard) ValidateQuery() hcl.Diagnostics

ValidateQuery implements QueryProvider

type DashboardCategory added in v0.17.0

type DashboardCategory struct {
	ResourceWithMetadataImpl
	ModTreeItemImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	// TACTICAL: include a title property (with a different name to the property in HclResourceImpl  for clarity)
	// This is purely to ensure the title is included in the panel properties of snapshots
	// Note: this will be parsed from HCL, but we must set this explicitly in setBaseProperties if there is a base
	CategoryTitle *string                               `cty:"title" hcl:"title" json:"title,omitempty"`
	Color         *string                               `cty:"color" hcl:"color" json:"color,omitempty"`
	Depth         *int                                  `cty:"depth" hcl:"depth" json:"depth,omitempty"`
	Icon          *string                               `cty:"icon" hcl:"icon" json:"icon,omitempty"`
	HREF          *string                               `cty:"href" hcl:"href" json:"href,omitempty"`
	Fold          *DashboardCategoryFold                `cty:"fold" hcl:"fold,block" json:"fold,omitempty"`
	PropertyList  DashboardCategoryPropertyList         `cty:"property_list" hcl:"property,block" column:"properties,jsonb" json:"-"`
	Properties    map[string]*DashboardCategoryProperty `cty:"properties" json:"properties,omitempty"`
	PropertyOrder []string                              `cty:"property_order" hcl:"property_order,optional" json:"property_order,omitempty"`
	Base          *DashboardCategory                    `hcl:"base" json:"-"`
}

func (*DashboardCategory) CtyValue added in v0.17.0

func (c *DashboardCategory) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*DashboardCategory) Diff added in v0.17.0

func (*DashboardCategory) Equals added in v0.17.0

func (c *DashboardCategory) Equals(other *DashboardCategory) bool

func (*DashboardCategory) OnDecoded added in v0.17.0

func (c *DashboardCategory) OnDecoded(block *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

type DashboardCategoryFold added in v0.17.0

type DashboardCategoryFold struct {
	Title     *string `cty:"title" hcl:"title" json:"title,omitempty"`
	Threshold *int    `cty:"threshold" hcl:"threshold" json:"threshold,omitempty"`
	Icon      *string `cty:"icon" hcl:"icon" json:"icon,omitempty"`
}

func (DashboardCategoryFold) Equals added in v0.17.0

type DashboardCategoryList added in v0.17.0

type DashboardCategoryList []*DashboardCategory

func (*DashboardCategoryList) Merge added in v0.17.0

type DashboardCategoryProperty added in v0.19.0

type DashboardCategoryProperty struct {
	ShortName string  `hcl:"name,label" json:"name"`
	Display   *string `cty:"display" hcl:"display" json:"display,omitempty"`
	Wrap      *string `cty:"wrap" hcl:"wrap" json:"wrap,omitempty"`
	HREF      *string `cty:"href" hcl:"href" json:"href,omitempty"`
}

func (DashboardCategoryProperty) Equals added in v0.19.0

type DashboardCategoryPropertyList added in v0.19.0

type DashboardCategoryPropertyList []*DashboardCategoryProperty

func (*DashboardCategoryPropertyList) Merge added in v0.19.0

type DashboardChart

type DashboardChart struct {
	ResourceWithMetadataImpl
	QueryProviderImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	Width      *int                             `cty:"width" hcl:"width" column:"width,text" json:"-"`
	Type       *string                          `cty:"type" hcl:"type" column:"type,text" json:"-"`
	Display    *string                          `cty:"display" hcl:"display" json:"-"`
	Legend     *DashboardChartLegend            `cty:"legend" hcl:"legend,block" column:"legend,jsonb" json:"legend,omitempty"`
	SeriesList DashboardChartSeriesList         `cty:"series_list" hcl:"series,block" column:"series,jsonb" json:"-"`
	Axes       *DashboardChartAxes              `cty:"axes" hcl:"axes,block" column:"axes,jsonb" json:"axes,omitempty"`
	Grouping   *string                          `cty:"grouping" hcl:"grouping" json:"grouping,omitempty"`
	Transform  *string                          `cty:"transform" hcl:"transform" json:"transform,omitempty"`
	Series     map[string]*DashboardChartSeries `cty:"series" json:"series,omitempty"`
	Base       *DashboardChart                  `hcl:"base" json:"-"`
}

DashboardChart is a struct representing a leaf dashboard node

func (*DashboardChart) CtyValue

func (c *DashboardChart) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*DashboardChart) Diff

func (*DashboardChart) Equals

func (c *DashboardChart) Equals(other *DashboardChart) bool

func (*DashboardChart) GetDisplay

func (c *DashboardChart) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*DashboardChart) GetType

func (c *DashboardChart) GetType() string

GetType implements DashboardLeafNode

func (*DashboardChart) GetWidth

func (c *DashboardChart) GetWidth() int

GetWidth implements DashboardLeafNode

func (*DashboardChart) OnDecoded

func (c *DashboardChart) OnDecoded(block *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

type DashboardChartAxes

type DashboardChartAxes struct {
	X *DashboardChartAxesX `cty:"x" hcl:"x,block" json:"x,omitempty"`
	Y *DashboardChartAxesY `cty:"y" hcl:"y,block" json:"y,omitempty"`
}

func (*DashboardChartAxes) Equals

func (a *DashboardChartAxes) Equals(other *DashboardChartAxes) bool

func (*DashboardChartAxes) Merge

func (a *DashboardChartAxes) Merge(other *DashboardChartAxes)

type DashboardChartAxesX

type DashboardChartAxesX struct {
	Title  *DashboardChartAxisTitle `cty:"title" hcl:"title,block" json:"title,omitempty"`
	Labels *DashboardChartLabels    `cty:"labels" hcl:"labels,block" json:"labels,omitempty"`
	Min    *int                     `cty:"min" hcl:"min" json:"min,omitempty"`
	Max    *int                     `cty:"max" hcl:"max" json:"max,omitempty"`
}

func (*DashboardChartAxesX) Equals

func (x *DashboardChartAxesX) Equals(other *DashboardChartAxesX) bool

func (*DashboardChartAxesX) Merge

func (x *DashboardChartAxesX) Merge(other *DashboardChartAxesX)

type DashboardChartAxesY

type DashboardChartAxesY struct {
	Title  *DashboardChartAxisTitle `cty:"title" hcl:"title,block" json:"title,omitempty"`
	Labels *DashboardChartLabels    `cty:"labels" hcl:"labels,block" json:"labels,omitempty"`
	Min    *int                     `cty:"min" hcl:"min" json:"min,omitempty"`
	Max    *int                     `cty:"max" hcl:"max" json:"max,omitempty"`
}

func (*DashboardChartAxesY) Equals

func (y *DashboardChartAxesY) Equals(other *DashboardChartAxesY) bool

func (*DashboardChartAxesY) Merge

func (y *DashboardChartAxesY) Merge(other *DashboardChartAxesY)

type DashboardChartAxisTitle

type DashboardChartAxisTitle struct {
	Display *string `cty:"display" hcl:"display" json:"display,omitempty"`
	Align   *string `cty:"align" hcl:"align" json:"align,omitempty"`
	Value   *string `cty:"value" hcl:"value" json:"value,omitempty"`
}

func (*DashboardChartAxisTitle) Equals

func (*DashboardChartAxisTitle) Merge

type DashboardChartLabels

type DashboardChartLabels struct {
	Display *string `cty:"display" hcl:"display" json:"display,omitempty"`
	Format  *string `cty:"format" hcl:"format" json:"format,omitempty"`
}

func (*DashboardChartLabels) Equals

func (*DashboardChartLabels) Merge

func (l *DashboardChartLabels) Merge(other *DashboardChartLabels)

type DashboardChartLegend

type DashboardChartLegend struct {
	Display  *string `cty:"display" hcl:"display" json:"display,omitempty"`
	Position *string `cty:"position" hcl:"position" json:"position,omitempty"`
}

func (*DashboardChartLegend) Equals

func (*DashboardChartLegend) Merge

func (l *DashboardChartLegend) Merge(other *DashboardChartLegend)

type DashboardChartSeries

type DashboardChartSeries struct {
	Name       string                                `hcl:"name,label" json:"name"`
	Title      *string                               `cty:"title" hcl:"title" json:"title,omitempty"`
	Color      *string                               `cty:"color" hcl:"color" json:"color,omitempty"`
	Points     map[string]*DashboardChartSeriesPoint `cty:"points" json:"points,omitempty"`
	PointsList []*DashboardChartSeriesPoint          `hcl:"point,block" json:"-"`
}

func (DashboardChartSeries) Equals

func (*DashboardChartSeries) OnDecoded

func (s *DashboardChartSeries) OnDecoded()

type DashboardChartSeriesList

type DashboardChartSeriesList []*DashboardChartSeries

func (*DashboardChartSeriesList) Merge

type DashboardChartSeriesPoint

type DashboardChartSeriesPoint struct {
	Name  string  `hcl:"name,label" json:"-"`
	Color *string `cty:"color" hcl:"color" json:"color,omitempty"`
}

func (DashboardChartSeriesPoint) Equals

type DashboardContainer

type DashboardContainer struct {
	ResourceWithMetadataImpl
	ModTreeItemImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	Width   *int              `cty:"width" hcl:"width"  column:"width,text"`
	Display *string           `cty:"display" hcl:"display"`
	Inputs  []*DashboardInput `cty:"inputs" column:"inputs,jsonb"`
	// store children in a way which can be serialised via cty
	ChildNames []string `cty:"children" column:"children,jsonb"`
	// contains filtered or unexported fields
}

DashboardContainer is a struct representing the Dashboard and Container resource

func (*DashboardContainer) AddChild

func (c *DashboardContainer) AddChild(child ModTreeItem)

func (*DashboardContainer) CtyValue

func (c *DashboardContainer) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*DashboardContainer) Diff

func (*DashboardContainer) Equals

func (c *DashboardContainer) Equals(other *DashboardContainer) bool

func (*DashboardContainer) GetDisplay added in v0.19.0

func (c *DashboardContainer) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*DashboardContainer) GetType added in v0.19.0

func (c *DashboardContainer) GetType() string

GetType implements DashboardLeafNode

func (*DashboardContainer) GetWidth added in v0.19.0

func (c *DashboardContainer) GetWidth() int

GetWidth implements DashboardLeafNode

func (*DashboardContainer) OnDecoded

func (c *DashboardContainer) OnDecoded(block *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

func (*DashboardContainer) SetChildren

func (c *DashboardContainer) SetChildren(children []ModTreeItem)

func (*DashboardContainer) WalkResources

func (c *DashboardContainer) WalkResources(resourceFunc func(resource HclResource) (bool, error)) error

type DashboardEdge added in v0.17.0

type DashboardEdge struct {
	ResourceWithMetadataImpl
	QueryProviderImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	Category *DashboardCategory `cty:"category" hcl:"category" column:"category,jsonb" json:"category,omitempty"`
	Base     *DashboardEdge     `hcl:"base" json:"-"`
}

DashboardEdge is a struct representing a leaf dashboard node

func (*DashboardEdge) CtyValue added in v0.17.0

func (e *DashboardEdge) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*DashboardEdge) Diff added in v0.17.0

func (*DashboardEdge) Equals added in v0.17.0

func (e *DashboardEdge) Equals(other *DashboardEdge) bool

func (*DashboardEdge) GetDisplay added in v0.17.0

func (e *DashboardEdge) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*DashboardEdge) GetDocumentation added in v0.17.0

func (e *DashboardEdge) GetDocumentation() string

GetDocumentation implements DashboardLeafNode

func (*DashboardEdge) GetType added in v0.17.0

func (e *DashboardEdge) GetType() string

GetType implements DashboardLeafNode

func (*DashboardEdge) GetWidth added in v0.17.0

func (e *DashboardEdge) GetWidth() int

GetWidth implements DashboardLeafNode

func (*DashboardEdge) OnDecoded added in v0.17.0

func (e *DashboardEdge) OnDecoded(_ *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

type DashboardEdgeList added in v0.17.0

type DashboardEdgeList []*DashboardEdge

func (*DashboardEdgeList) Contains added in v0.19.0

func (l *DashboardEdgeList) Contains(other *DashboardEdge) bool

func (*DashboardEdgeList) Get added in v0.19.0

func (l *DashboardEdgeList) Get(name string) *DashboardEdge

func (*DashboardEdgeList) Merge added in v0.17.0

func (l *DashboardEdgeList) Merge(other DashboardEdgeList)

func (*DashboardEdgeList) Names added in v0.17.0

func (l *DashboardEdgeList) Names() []string

type DashboardFlow

type DashboardFlow struct {
	ResourceWithMetadataImpl
	QueryProviderImpl
	WithProviderImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	Nodes     DashboardNodeList `cty:"node_list"  column:"nodes,jsonb" json:"-"`
	Edges     DashboardEdgeList `cty:"edge_list" column:"edges,jsonb" json:"-"`
	NodeNames []string          `json:"nodes"`
	EdgeNames []string          `json:"edges"`

	Categories map[string]*DashboardCategory `cty:"categories" json:"categories"`

	Width   *int    `cty:"width" hcl:"width" column:"width,text" json:"-"`
	Type    *string `cty:"type" hcl:"type" column:"type,text" json:"-"`
	Display *string `cty:"display" hcl:"display" json:"-"`

	Base *DashboardFlow `hcl:"base" json:"-"`
}

DashboardFlow is a struct representing a leaf dashboard node

func (*DashboardFlow) AddCategory added in v0.17.0

func (f *DashboardFlow) AddCategory(category *DashboardCategory) hcl.Diagnostics

AddCategory implements NodeAndEdgeProvider

func (*DashboardFlow) AddChild added in v0.19.0

func (f *DashboardFlow) AddChild(child HclResource) hcl.Diagnostics

AddChild implements NodeAndEdgeProvider

func (*DashboardFlow) CtyValue

func (f *DashboardFlow) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*DashboardFlow) Diff

func (*DashboardFlow) Equals

func (f *DashboardFlow) Equals(other *DashboardFlow) bool

func (*DashboardFlow) GetChildren

func (f *DashboardFlow) GetChildren() []ModTreeItem

TODO [node_reuse] Add DashboardLeafNodeImpl and move this there https://github.com/turbot/steampipe/issues/2926 GetChildren implements ModTreeItem

func (*DashboardFlow) GetDisplay

func (f *DashboardFlow) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*DashboardFlow) GetEdges added in v0.17.0

func (f *DashboardFlow) GetEdges() DashboardEdgeList

GetEdges implements NodeAndEdgeProvider

func (*DashboardFlow) GetNodes added in v0.17.0

func (f *DashboardFlow) GetNodes() DashboardNodeList

GetNodes implements NodeAndEdgeProvider

func (*DashboardFlow) GetType

func (f *DashboardFlow) GetType() string

GetType implements DashboardLeafNode

func (*DashboardFlow) GetWidth

func (f *DashboardFlow) GetWidth() int

GetWidth implements DashboardLeafNode

func (*DashboardFlow) OnDecoded

func (f *DashboardFlow) OnDecoded(block *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

func (*DashboardFlow) SetEdges added in v0.17.0

func (f *DashboardFlow) SetEdges(edges DashboardEdgeList)

SetEdges implements NodeAndEdgeProvider

func (*DashboardFlow) SetNodes added in v0.17.0

func (f *DashboardFlow) SetNodes(nodes DashboardNodeList)

SetNodes implements NodeAndEdgeProvider

func (*DashboardFlow) ValidateQuery added in v0.19.0

func (*DashboardFlow) ValidateQuery() hcl.Diagnostics

ValidateQuery implements QueryProvider

type DashboardGraph added in v0.17.0

type DashboardGraph struct {
	ResourceWithMetadataImpl
	QueryProviderImpl
	WithProviderImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	Nodes     DashboardNodeList `cty:"node_list" column:"nodes,jsonb" json:"-"`
	Edges     DashboardEdgeList `cty:"edge_list" column:"edges,jsonb" json:"-"`
	NodeNames []string          `json:"nodes"`
	EdgeNames []string          `json:"edges"`

	Categories map[string]*DashboardCategory `cty:"categories" json:"categories"`
	Direction  *string                       `cty:"direction" hcl:"direction" column:"direction,text" json:"direction"`

	// these properties are JSON serialised by the parent LeafRun
	Width   *int    `cty:"width" hcl:"width" column:"width,text" json:"-"`
	Type    *string `cty:"type" hcl:"type" column:"type,text" json:"-"`
	Display *string `cty:"display" hcl:"display" json:"-"`

	Base *DashboardGraph `hcl:"base" json:"-"`
}

DashboardGraph is a struct representing a leaf dashboard node

func (*DashboardGraph) AddCategory added in v0.17.0

func (g *DashboardGraph) AddCategory(category *DashboardCategory) hcl.Diagnostics

AddCategory implements NodeAndEdgeProvider

func (*DashboardGraph) AddChild added in v0.19.0

func (g *DashboardGraph) AddChild(child HclResource) hcl.Diagnostics

AddChild implements NodeAndEdgeProvider

func (*DashboardGraph) CtyValue added in v0.17.0

func (g *DashboardGraph) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*DashboardGraph) Diff added in v0.17.0

func (*DashboardGraph) Equals added in v0.17.0

func (g *DashboardGraph) Equals(other *DashboardGraph) bool

func (*DashboardGraph) GetChildren added in v0.17.0

func (g *DashboardGraph) GetChildren() []ModTreeItem

GetChildren implements ModTreeItem

func (*DashboardGraph) GetDisplay added in v0.17.0

func (g *DashboardGraph) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*DashboardGraph) GetEdges added in v0.17.0

func (g *DashboardGraph) GetEdges() DashboardEdgeList

GetEdges implements NodeAndEdgeProvider

func (*DashboardGraph) GetNodes added in v0.17.0

func (g *DashboardGraph) GetNodes() DashboardNodeList

GetNodes implements NodeAndEdgeProvider

func (*DashboardGraph) GetType added in v0.17.0

func (g *DashboardGraph) GetType() string

GetType implements DashboardLeafNode

func (*DashboardGraph) GetWidth added in v0.17.0

func (g *DashboardGraph) GetWidth() int

GetWidth implements DashboardLeafNode

func (*DashboardGraph) OnDecoded added in v0.17.0

func (g *DashboardGraph) OnDecoded(block *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

func (*DashboardGraph) SetEdges added in v0.17.0

func (g *DashboardGraph) SetEdges(edges DashboardEdgeList)

SetEdges implements NodeAndEdgeProvider

func (*DashboardGraph) SetNodes added in v0.17.0

func (g *DashboardGraph) SetNodes(nodes DashboardNodeList)

SetNodes implements NodeAndEdgeProvider

type DashboardHierarchy

type DashboardHierarchy struct {
	ResourceWithMetadataImpl
	QueryProviderImpl
	WithProviderImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	Nodes     DashboardNodeList `cty:"node_list" column:"nodes,jsonb" json:"-"`
	Edges     DashboardEdgeList `cty:"edge_list" column:"edges,jsonb" json:"-"`
	NodeNames []string          `json:"nodes"`
	EdgeNames []string          `json:"edges"`

	Categories map[string]*DashboardCategory `cty:"categories" json:"categories"`
	Width      *int                          `cty:"width" hcl:"width" column:"width,text" json:"-"`
	Type       *string                       `cty:"type" hcl:"type" column:"type,text" json:"-"`
	Display    *string                       `cty:"display" hcl:"display" json:"-"`

	Base *DashboardHierarchy `hcl:"base" json:"-"`
	// contains filtered or unexported fields
}

DashboardHierarchy is a struct representing a leaf dashboard node

func (*DashboardHierarchy) AddCategory added in v0.17.0

func (h *DashboardHierarchy) AddCategory(category *DashboardCategory) hcl.Diagnostics

AddCategory implements NodeAndEdgeProvider

func (*DashboardHierarchy) AddChild added in v0.19.0

func (h *DashboardHierarchy) AddChild(child HclResource) hcl.Diagnostics

AddChild implements NodeAndEdgeProvider

func (*DashboardHierarchy) CtyValue

func (h *DashboardHierarchy) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*DashboardHierarchy) Diff

func (*DashboardHierarchy) Equals

func (h *DashboardHierarchy) Equals(other *DashboardHierarchy) bool

func (*DashboardHierarchy) GetChildren

func (h *DashboardHierarchy) GetChildren() []ModTreeItem

GetChildren implements ModTreeItem

func (*DashboardHierarchy) GetDisplay

func (h *DashboardHierarchy) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*DashboardHierarchy) GetDocumentation

func (h *DashboardHierarchy) GetDocumentation() string

GetDocumentation implements DashboardLeafNode, ModTreeItem

func (*DashboardHierarchy) GetEdges added in v0.17.0

func (h *DashboardHierarchy) GetEdges() DashboardEdgeList

GetEdges implements NodeAndEdgeProvider

func (*DashboardHierarchy) GetNodes added in v0.17.0

func (h *DashboardHierarchy) GetNodes() DashboardNodeList

GetNodes implements NodeAndEdgeProvider

func (*DashboardHierarchy) GetType

func (h *DashboardHierarchy) GetType() string

GetType implements DashboardLeafNode

func (*DashboardHierarchy) GetWidth

func (h *DashboardHierarchy) GetWidth() int

GetWidth implements DashboardLeafNode

func (*DashboardHierarchy) OnDecoded

func (h *DashboardHierarchy) OnDecoded(block *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

func (*DashboardHierarchy) SetEdges added in v0.17.0

func (h *DashboardHierarchy) SetEdges(edges DashboardEdgeList)

SetEdges implements NodeAndEdgeProvider

func (*DashboardHierarchy) SetNodes added in v0.17.0

func (h *DashboardHierarchy) SetNodes(nodes DashboardNodeList)

SetNodes implements NodeAndEdgeProvider

type DashboardImage

type DashboardImage struct {
	ResourceWithMetadataImpl
	QueryProviderImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	Src *string `cty:"src" hcl:"src" column:"src,text" json:"src,omitempty"`
	Alt *string `cty:"alt" hcl:"alt" column:"alt,text" json:"alt,omitempty"`

	// these properties are JSON serialised by the parent LeafRun
	Width   *int    `cty:"width" hcl:"width" column:"width,text" json:"-"`
	Display *string `cty:"display" hcl:"display" json:"-"`

	Base *DashboardImage `hcl:"base" json:"-"`
}

DashboardImage is a struct representing a leaf dashboard node

func (*DashboardImage) CtyValue

func (i *DashboardImage) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*DashboardImage) Diff

func (*DashboardImage) Equals

func (i *DashboardImage) Equals(other *DashboardImage) bool

func (*DashboardImage) GetDisplay

func (i *DashboardImage) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*DashboardImage) GetDocumentation

func (*DashboardImage) GetDocumentation() string

GetDocumentation implements DashboardLeafNode, ModTreeItem

func (*DashboardImage) GetType

func (*DashboardImage) GetType() string

GetType implements DashboardLeafNode

func (*DashboardImage) GetWidth

func (i *DashboardImage) GetWidth() int

GetWidth implements DashboardLeafNode

func (*DashboardImage) OnDecoded

func (i *DashboardImage) OnDecoded(block *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

func (*DashboardImage) ValidateQuery added in v0.19.0

func (i *DashboardImage) ValidateQuery() hcl.Diagnostics

ValidateQuery implements QueryProvider

type DashboardInput

type DashboardInput struct {
	ResourceWithMetadataImpl
	QueryProviderImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	DashboardName string                  `column:"dashboard,text" json:"-"`
	Label         *string                 `cty:"label" hcl:"label" column:"label,text" json:"label,omitempty"`
	Placeholder   *string                 `cty:"placeholder" hcl:"placeholder" column:"placeholder,text" json:"placeholder,omitempty"`
	Options       []*DashboardInputOption `cty:"options" hcl:"option,block" json:"options,omitempty"`
	// tactical - exists purely so we can put "unqualified_name" in the snbapshot panel for the input
	// TODO remove when input names are refactored https://github.com/turbot/steampipe/issues/2863
	InputName string `cty:"input_name" json:"unqualified_name"`

	// these properties are JSON serialised by the parent LeafRun
	Width   *int            `cty:"width" hcl:"width" column:"width,text" json:"-"`
	Type    *string         `cty:"type" hcl:"type" column:"type,text" json:"-"`
	Display *string         `cty:"display" hcl:"display" json:"-"`
	Base    *DashboardInput `hcl:"base" json:"-"`
	// contains filtered or unexported fields
}

DashboardInput is a struct representing a leaf dashboard node

func GetDashboardInput

func GetDashboardInput(provider ResourceMapsProvider, inputName, dashboardName string) (*DashboardInput, bool)

GetDashboardInput looks for an input with a given parent dashboard this is required as GetResource does not support Inputs

func (*DashboardInput) Clone

func (i *DashboardInput) Clone() *DashboardInput

TODO remove https://github.com/turbot/steampipe/issues/2864

func (*DashboardInput) CtyValue

func (i *DashboardInput) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*DashboardInput) DependsOnInput

func (i *DashboardInput) DependsOnInput(changedInputName string) bool

DependsOnInput returns whether this input has a runtime dependency on the given input¬

func (*DashboardInput) Diff

func (*DashboardInput) Equals

func (i *DashboardInput) Equals(other *DashboardInput) bool

func (*DashboardInput) GetDisplay

func (i *DashboardInput) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*DashboardInput) GetType

func (i *DashboardInput) GetType() string

GetType implements DashboardLeafNode

func (*DashboardInput) GetWidth

func (i *DashboardInput) GetWidth() int

GetWidth implements DashboardLeafNode

func (*DashboardInput) OnDecoded

func (i *DashboardInput) OnDecoded(_ *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

func (*DashboardInput) SetDashboard

func (i *DashboardInput) SetDashboard(dashboard *Dashboard)

SetDashboard sets the parent dashboard container

func (*DashboardInput) ValidateQuery added in v0.19.0

func (i *DashboardInput) ValidateQuery() hcl.Diagnostics

ValidateQuery implements QueryProvider

type DashboardInputOption

type DashboardInputOption struct {
	Name  string  `hcl:"name,label" json:"name"`
	Label *string `cty:"label" hcl:"label" json:"label,omitempty"`
}

DashboardInputOption is a struct representing dashboard input option

func (DashboardInputOption) Equals

type DashboardLeafNode

type DashboardLeafNode interface {
	ModTreeItem
	ResourceWithMetadata
	GetDisplay() string
	GetType() string
	GetWidth() int
}

DashboardLeafNode must be implemented by resources may be a leaf node in the dashboard execution tree

type DashboardNode added in v0.17.0

type DashboardNode struct {
	ResourceWithMetadataImpl
	QueryProviderImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	Category *DashboardCategory `cty:"category" hcl:"category" column:"category,jsonb" json:"category,omitempty"`
	Base     *DashboardNode     `hcl:"base" json:"-"`
}

DashboardNode is a struct representing a leaf dashboard node

func (*DashboardNode) CtyValue added in v0.17.0

func (n *DashboardNode) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*DashboardNode) Diff added in v0.17.0

func (*DashboardNode) Equals added in v0.17.0

func (n *DashboardNode) Equals(other *DashboardNode) bool

func (*DashboardNode) GetDisplay added in v0.17.0

func (n *DashboardNode) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*DashboardNode) GetType added in v0.17.0

func (n *DashboardNode) GetType() string

GetType implements DashboardLeafNode

func (*DashboardNode) GetWidth added in v0.17.0

func (n *DashboardNode) GetWidth() int

GetWidth implements DashboardLeafNode

func (*DashboardNode) OnDecoded added in v0.17.0

func (n *DashboardNode) OnDecoded(_ *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource—

type DashboardNodeList added in v0.17.0

type DashboardNodeList []*DashboardNode

func (*DashboardNodeList) Contains added in v0.19.0

func (l *DashboardNodeList) Contains(other *DashboardNode) bool

func (*DashboardNodeList) Get added in v0.19.0

func (l *DashboardNodeList) Get(name string) *DashboardNode

func (*DashboardNodeList) Merge added in v0.17.0

func (l *DashboardNodeList) Merge(other DashboardNodeList)

func (*DashboardNodeList) Names added in v0.17.0

func (l *DashboardNodeList) Names() []string

type DashboardTable

type DashboardTable struct {
	ResourceWithMetadataImpl
	QueryProviderImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	// TODO remove - check introspection tables
	Width      *int                             `cty:"width" hcl:"width" column:"width,text" json:"-"`
	Type       *string                          `cty:"type" hcl:"type" column:"type,text" json:"-"`
	ColumnList DashboardTableColumnList         `cty:"column_list" hcl:"column,block" column:"columns,jsonb" json:"-"`
	Columns    map[string]*DashboardTableColumn `cty:"columns" json:"columns,omitempty"`
	Display    *string                          `cty:"display" hcl:"display" json:"display,omitempty"`
	Base       *DashboardTable                  `hcl:"base" json:"-"`
}

DashboardTable is a struct representing a leaf dashboard node

func NewQueryDashboardTable added in v0.17.0

func NewQueryDashboardTable(qp QueryProvider) (*DashboardTable, error)

NewQueryDashboardTable creates a Table to wrap a query. This is used in order to execute queries as dashboards

func (*DashboardTable) CtyValue

func (t *DashboardTable) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*DashboardTable) Diff

func (*DashboardTable) Equals

func (t *DashboardTable) Equals(other *DashboardTable) bool

func (*DashboardTable) GetDisplay

func (t *DashboardTable) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*DashboardTable) GetDocumentation

func (*DashboardTable) GetDocumentation() string

GetDocumentation implements DashboardLeafNode, ModTreeItem

func (*DashboardTable) GetType

func (t *DashboardTable) GetType() string

GetType implements DashboardLeafNode

func (*DashboardTable) GetWidth

func (t *DashboardTable) GetWidth() int

GetWidth implements DashboardLeafNode

func (*DashboardTable) OnDecoded

func (t *DashboardTable) OnDecoded(_ *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

type DashboardTableColumn

type DashboardTableColumn struct {
	Name    string  `hcl:"name,label" json:"name"`
	Display *string `cty:"display" hcl:"display" json:"display,omitempty"`
	Wrap    *string `cty:"wrap" hcl:"wrap" json:"wrap,omitempty"`
	HREF    *string `cty:"href" hcl:"href" json:"href,omitempty"`
}

func (DashboardTableColumn) Equals

type DashboardTableColumnList

type DashboardTableColumnList []*DashboardTableColumn

func (*DashboardTableColumnList) Merge

type DashboardText

type DashboardText struct {
	ResourceWithMetadataImpl
	ModTreeItemImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	Value   *string `cty:"value" hcl:"value" column:"value,text" json:"value,omitempty"`
	Width   *int    `cty:"width" hcl:"width" column:"width,text" json:"-"`
	Type    *string `cty:"type" hcl:"type" column:"type,text" json:"-"`
	Display *string `cty:"display" hcl:"display" json:"-"`

	Base *DashboardText `hcl:"base" json:"-"`
	Mod  *Mod           `cty:"mod" json:"-"`
}

DashboardText is a struct representing a leaf dashboard node

func (*DashboardText) CtyValue

func (t *DashboardText) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*DashboardText) Diff

func (*DashboardText) Equals

func (t *DashboardText) Equals(other *DashboardText) bool

func (*DashboardText) GetDisplay

func (t *DashboardText) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*DashboardText) GetDocumentation

func (*DashboardText) GetDocumentation() string

GetDocumentation implements DashboardLeafNode, ModTreeItem

func (*DashboardText) GetType

func (t *DashboardText) GetType() string

GetType implements DashboardLeafNode

func (*DashboardText) GetWidth

func (t *DashboardText) GetWidth() int

GetWidth implements DashboardLeafNode

func (*DashboardText) OnDecoded

func (t *DashboardText) OnDecoded(*hcl.Block, ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

type DashboardTreeItemDiffs

type DashboardTreeItemDiffs struct {
	Name              string
	Item              ModTreeItem
	ChangedProperties []string
	AddedItems        []string
	RemovedItems      []string
}

DashboardTreeItemDiffs is a struct representing the differences between 2 DashboardTreeItems (of same type)

func (*DashboardTreeItemDiffs) AddAddedItem

func (d *DashboardTreeItemDiffs) AddAddedItem(name string)

func (*DashboardTreeItemDiffs) AddPropertyDiff

func (d *DashboardTreeItemDiffs) AddPropertyDiff(propertyName string)

func (*DashboardTreeItemDiffs) AddRemovedItem

func (d *DashboardTreeItemDiffs) AddRemovedItem(name string)

func (*DashboardTreeItemDiffs) HasChanges

func (d *DashboardTreeItemDiffs) HasChanges() bool

type DashboardWith added in v0.19.0

type DashboardWith struct {
	ResourceWithMetadataImpl
	QueryProviderImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`
}

DashboardWith is a struct representing a leaf dashboard node

func (*DashboardWith) CtyValue added in v0.19.0

func (w *DashboardWith) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*DashboardWith) Diff added in v0.19.0

func (*DashboardWith) Equals added in v0.19.0

func (w *DashboardWith) Equals(other *DashboardWith) bool

func (*DashboardWith) GetDisplay added in v0.19.0

func (*DashboardWith) GetDisplay() string

GetDisplay implements DashboardLeafNode

func (*DashboardWith) GetType added in v0.19.0

func (*DashboardWith) GetType() string

GetType implements DashboardLeafNode

func (*DashboardWith) GetWidth added in v0.19.0

func (*DashboardWith) GetWidth() int

GetWidth implements DashboardLeafNode

func (*DashboardWith) OnDecoded added in v0.19.0

func (w *DashboardWith) OnDecoded(_ *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

type ErrorAndWarnings added in v0.19.0

type ErrorAndWarnings struct {
	Error    error
	Warnings []string
}

func NewErrorsAndWarning added in v0.19.0

func NewErrorsAndWarning(err error, warnings ...string) *ErrorAndWarnings

func (*ErrorAndWarnings) AddWarning added in v0.19.0

func (r *ErrorAndWarnings) AddWarning(warnings ...string)

func (*ErrorAndWarnings) GetError added in v0.19.0

func (r *ErrorAndWarnings) GetError() error

func (*ErrorAndWarnings) ShowWarnings added in v0.19.0

func (r *ErrorAndWarnings) ShowWarnings()

type HclResource

type HclResource interface {
	// TODO  [node_reuse] rename to GetName/GetFullName
	Name() string
	GetTitle() string
	GetUnqualifiedName() string
	OnDecoded(*hcl.Block, ResourceMapsProvider) hcl.Diagnostics
	GetDeclRange() *hcl.Range
	BlockType() string
	GetDescription() string
	GetDocumentation() string
	GetTags() map[string]string
	SetTopLevel(bool)
	IsTopLevel() bool
	GetBase() HclResource
	GetHclResourceImpl() *HclResourceImpl
}

HclResource must be implemented by resources defined in HCL

func NewBenchmark

func NewBenchmark(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewControl

func NewControl(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboard

func NewDashboard(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboardCard

func NewDashboardCard(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboardCategory added in v0.17.0

func NewDashboardCategory(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboardChart

func NewDashboardChart(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboardContainer

func NewDashboardContainer(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboardEdge added in v0.17.0

func NewDashboardEdge(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboardFlow

func NewDashboardFlow(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboardGraph added in v0.17.0

func NewDashboardGraph(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboardHierarchy

func NewDashboardHierarchy(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboardImage

func NewDashboardImage(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboardInput

func NewDashboardInput(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboardNode added in v0.17.0

func NewDashboardNode(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboardTable

func NewDashboardTable(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboardText

func NewDashboardText(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewDashboardWith added in v0.19.0

func NewDashboardWith(block *hcl.Block, mod *Mod, shortName string) HclResource

func NewQuery

func NewQuery(block *hcl.Block, mod *Mod, shortName string) HclResource

type HclResourceImpl added in v0.19.0

type HclResourceImpl struct {
	// required to allow partial decoding
	HclResourceRemain hcl.Body `hcl:",remain" json:"-"`

	FullName        string            `cty:"name" json:"-"`
	Title           *string           `cty:"title" hcl:"title" column:"title,text" json:"-"`
	ShortName       string            `cty:"short_name" hcl:"name,label" json:"name"`
	UnqualifiedName string            `cty:"unqualified_name" json:"-"`
	Description     *string           `cty:"description" hcl:"description" column:"description,text" json:"-"`
	Documentation   *string           `cty:"documentation" hcl:"documentation" column:"documentation,text" json:"-"`
	DeclRange       hcl.Range         `json:"-"`
	Tags            map[string]string `cty:"tags" hcl:"tags,optional" column:"tags,jsonb" json:"-"`
	// contains filtered or unexported fields
}

func (*HclResourceImpl) BlockType added in v0.19.0

func (b *HclResourceImpl) BlockType() string

BlockType implements HclResource

func (*HclResourceImpl) CtyValue added in v0.19.0

func (b *HclResourceImpl) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*HclResourceImpl) GetBase added in v0.19.0

func (b *HclResourceImpl) GetBase() HclResource

GetBase implements HclResource

func (*HclResourceImpl) GetDeclRange added in v0.19.0

func (b *HclResourceImpl) GetDeclRange() *hcl.Range

GetDeclRange implements HclResource

func (*HclResourceImpl) GetDescription added in v0.19.0

func (b *HclResourceImpl) GetDescription() string

GetDescription implements HclResource

func (*HclResourceImpl) GetDocumentation added in v0.19.0

func (b *HclResourceImpl) GetDocumentation() string

GetDocumentation implements HclResource

func (*HclResourceImpl) GetHclResourceImpl added in v0.19.0

func (b *HclResourceImpl) GetHclResourceImpl() *HclResourceImpl

GetHclResourceBase implements HclResource

func (*HclResourceImpl) GetTags added in v0.19.0

func (b *HclResourceImpl) GetTags() map[string]string

GetTags implements HclResource

func (*HclResourceImpl) GetTitle added in v0.19.0

func (b *HclResourceImpl) GetTitle() string

GetTitle implements HclResource

func (*HclResourceImpl) GetUnqualifiedName added in v0.19.0

func (b *HclResourceImpl) GetUnqualifiedName() string

GetUnqualifiedName implements DashboardLeafNode, ModTreeItem

func (*HclResourceImpl) IsTopLevel added in v0.19.0

func (b *HclResourceImpl) IsTopLevel() bool

IsTopLevel implements HclResource

func (*HclResourceImpl) Name added in v0.19.0

func (b *HclResourceImpl) Name() string

Name implements HclResource return name in format: '<blocktype>.<shortName>'

func (*HclResourceImpl) OnDecoded added in v0.19.0

func (b *HclResourceImpl) OnDecoded(block *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

func (*HclResourceImpl) SetTopLevel added in v0.19.0

func (b *HclResourceImpl) SetTopLevel(isTopLevel bool)

SetTopLevel implements HclResource

type Local

type Local struct {
	ModTreeItemImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	Value cty.Value
	// contains filtered or unexported fields
}

Local is a struct representing a Local resource

func NewLocal

func NewLocal(name string, val cty.Value, declRange hcl.Range, mod *Mod) *Local

func (*Local) CtyValue

func (l *Local) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*Local) Diff

func (l *Local) Diff(other *Local) *DashboardTreeItemDiffs

type MappableResource

type MappableResource interface {
	HclResource
	ResourceWithMetadata
	// InitialiseFromFile creates a mappable resource from a file path
	// It returns the resource, and the raw file data
	InitialiseFromFile(modPath, filePath string) (MappableResource, []byte, error)
}

MappableResource must be implemented by resources which can be created directly from a content file (e.g. sql)

func QueryFromFile

func QueryFromFile(modPath, filePath string, mod *Mod) (MappableResource, []byte, error)

type MissingVariableError

type MissingVariableError struct {
	MissingVariables []*Variable
}

func (MissingVariableError) Error

func (m MissingVariableError) Error() string

type Mod

type Mod struct {
	ResourceWithMetadataImpl
	ModTreeItemImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	// ModDependencyPath is the fully qualified mod name, which can be used to 'require'  the mod,
	// e.g. github.com/turbot/steampipe-mod-azure-thrifty
	// This is only set if the mod is installed as a dependency
	ModDependencyPath string `cty:"mod_dependency_path"`

	// attributes
	Categories []string `cty:"categories" hcl:"categories,optional" column:"categories,jsonb"`
	Color      *string  `cty:"color" hcl:"color" column:"color,text"`
	Icon       *string  `cty:"icon" hcl:"icon" column:"icon,text"`

	// blocks
	Require       *Require
	LegacyRequire *Require   `hcl:"requires,block"`
	OpenGraph     *OpenGraph `hcl:"opengraph,block" column:"open_graph,jsonb"`

	VersionString string `cty:"version"`
	Version       *semver.Version

	// ModPath is the installation location of the mod
	ModPath string

	// convenient aggregation of all resources
	// NOTE: this resource map object references the same set of resources
	ResourceMaps *ResourceMaps
	// contains filtered or unexported fields
}

Mod is a struct representing a Mod resource

func CreateDefaultMod

func CreateDefaultMod(modPath string) *Mod

CreateDefaultMod creates a default mod created for a workspace with no mod definition

func NewMod

func NewMod(shortName, modPath string, defRange hcl.Range) *Mod

func (*Mod) AddModDependencies

func (m *Mod) AddModDependencies(modVersions map[string]*ModVersionConstraint)

func (*Mod) AddReference

func (m *Mod) AddReference(ref *ResourceReference)

AddReference implements ResourceWithMetadata (overridden from ResourceWithMetadataImpl)

func (*Mod) AddResource

func (m *Mod) AddResource(item HclResource) hcl.Diagnostics

func (*Mod) BuildResourceTree

func (m *Mod) BuildResourceTree(loadedDependencyMods ModMap) (err error)

BuildResourceTree builds the control tree structure by setting the parent property for each control and benchmark NOTE: this also builds the sorted benchmark list

func (*Mod) CtyValue

func (m *Mod) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*Mod) Equals

func (m *Mod) Equals(other *Mod) bool

func (*Mod) GetModDependency

func (m *Mod) GetModDependency(modName string) *ModVersionConstraint

func (*Mod) GetModDependencyPath

func (m *Mod) GetModDependencyPath() string

GetModDependencyPath ModDependencyPath if it is set. If not it returns NameWithVersion()

func (*Mod) GetPaths

func (m *Mod) GetPaths() []NodePath

GetPaths implements ModTreeItem (override base functionality)

func (*Mod) GetReferences

func (m *Mod) GetReferences() []*ResourceReference

GetReferences implements ResourceWithMetadata (overridden from ResourceWithMetadataImpl)

func (*Mod) GetResource added in v0.19.0

func (m *Mod) GetResource(parsedName *ParsedResourceName) (resource HclResource, found bool)

func (*Mod) GetResourceMaps

func (m *Mod) GetResourceMaps() *ResourceMaps

GetResourceMaps implements ResourceMapsProvider

func (*Mod) HasDependentMods

func (m *Mod) HasDependentMods() bool

func (*Mod) IsDefaultMod

func (m *Mod) IsDefaultMod() bool

IsDefaultMod returns whether this mod is a default mod created for a workspace with no mod definition

func (*Mod) NameWithVersion

func (m *Mod) NameWithVersion() string

func (*Mod) OnDecoded

func (m *Mod) OnDecoded(block *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

func (*Mod) RemoveAllModDependencies

func (m *Mod) RemoveAllModDependencies()

func (*Mod) RemoveModDependencies

func (m *Mod) RemoveModDependencies(modVersions map[string]*ModVersionConstraint)

func (*Mod) Save

func (m *Mod) Save() error

func (*Mod) SetFilePath

func (m *Mod) SetFilePath(modFilePath string)

func (*Mod) SetPaths

func (m *Mod) SetPaths()

SetPaths implements ModTreeItem (override base functionality)

func (*Mod) ValidateSteampipeVersion

func (m *Mod) ValidateSteampipeVersion() error

func (*Mod) WalkResources

func (m *Mod) WalkResources(resourceFunc func(item HclResource) (bool, error)) error

type ModMap

type ModMap map[string]*Mod

ModMap is a map of mod name to mod

type ModTreeItem

type ModTreeItem interface {
	HclResource
	AddParent(ModTreeItem) error
	GetParents() []ModTreeItem
	GetChildren() []ModTreeItem
	// GetPaths returns an array resource paths
	GetPaths() []NodePath
	SetPaths()
	GetMod() *Mod
	GetModTreeItemImpl() *ModTreeItemImpl
}

ModTreeItem must be implemented by elements of the mod resource hierarchy i.e. Control, Benchmark, Dashboard

type ModTreeItemImpl added in v0.19.0

type ModTreeItemImpl struct {
	HclResourceImpl
	// required to allow partial decoding
	ModTreeItemRemain hcl.Body `hcl:",remain" json:"-"`

	Mod   *Mod       `cty:"mod" json:"-"`
	Paths []NodePath `column:"path,jsonb" json:"-"`
	// contains filtered or unexported fields
}

func (*ModTreeItemImpl) AddParent added in v0.19.0

func (b *ModTreeItemImpl) AddParent(parent ModTreeItem) error

AddParent implements ModTreeItem

func (*ModTreeItemImpl) CtyValue added in v0.19.0

func (b *ModTreeItemImpl) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*ModTreeItemImpl) GetChildren added in v0.19.0

func (b *ModTreeItemImpl) GetChildren() []ModTreeItem

GetChildren implements ModTreeItem

func (*ModTreeItemImpl) GetMod added in v0.19.0

func (b *ModTreeItemImpl) GetMod() *Mod

func (*ModTreeItemImpl) GetModTreeItemImpl added in v0.19.0

func (b *ModTreeItemImpl) GetModTreeItemImpl() *ModTreeItemImpl

GetModTreeItemBase implements ModTreeItem

func (*ModTreeItemImpl) GetParents added in v0.19.0

func (b *ModTreeItemImpl) GetParents() []ModTreeItem

GetParents implements ModTreeItem

func (*ModTreeItemImpl) GetPaths added in v0.19.0

func (b *ModTreeItemImpl) GetPaths() []NodePath

func (*ModTreeItemImpl) SetPaths added in v0.19.0

func (b *ModTreeItemImpl) SetPaths()

SetPaths implements ModTreeItem

type ModVariableMap

type ModVariableMap struct {
	RootVariables       map[string]*Variable
	DependencyVariables map[string]map[string]*Variable
	// a map of top level AND dependency variables
	// used to set variable values from inputVariables
	AllVariables map[string]*Variable
	// the input variables evaluated in the parse
	VariableValues map[string]string
}

ModVariableMap is a struct containins maps of variable definitions

func NewModVariableMap

func NewModVariableMap(mod *Mod, dependencyMods ModMap) *ModVariableMap

NewModVariableMap builds a ModVariableMap using the variables from a mod and its dependencies

func (ModVariableMap) ToArray

func (m ModVariableMap) ToArray() []*Variable

type ModVersionConstraint

type ModVersionConstraint struct {
	// the fully qualified mod name, e.g. github.com/turbot/mod1
	Name          string `cty:"name" hcl:"name,label"`
	VersionString string `cty:"version" hcl:"version"`
	// variable values to be set on the dependency mod
	Args map[string]cty.Value `cty:"args"`
	// only one of Constraint, Branch and FilePath will be set
	Constraint *versionhelpers.Constraints
	// // NOTE: aliases will be supported in the future
	//Alias string `cty:"alias" hcl:"alias"`
	// the branch to use
	Branch string
	// the local file location to use
	FilePath  string
	DeclRange hcl.Range
}

func NewModVersionConstraint

func NewModVersionConstraint(modFullName string) (*ModVersionConstraint, error)

func (*ModVersionConstraint) Equals

func (*ModVersionConstraint) FullName

func (m *ModVersionConstraint) FullName() string

func (*ModVersionConstraint) HasVersion

func (m *ModVersionConstraint) HasVersion() bool

HasVersion returns whether the mod has a version specified, or is the latest if no version is specified, or the version is "latest", this is the latest version

func (*ModVersionConstraint) Initialise

func (m *ModVersionConstraint) Initialise() hcl.Diagnostics

Initialise parses the version and name properties

func (*ModVersionConstraint) String

func (m *ModVersionConstraint) String() string

type ModVersionConstraintCollection

type ModVersionConstraintCollection []*ModVersionConstraint

ModVersionConstraintCollection is a collection of ModVersionConstraint instances and implements the sort interface. See the sort package for more details. https://golang.org/pkg/sort/

func (ModVersionConstraintCollection) Len

Len returns the length of a collection. The number of Version instances on the slice.

func (ModVersionConstraintCollection) Less

Less is needed for the sort interface to compare two Version objects on the slice. If checks if one is less than the other.

func (ModVersionConstraintCollection) Swap

func (c ModVersionConstraintCollection) Swap(i, j int)

Swap is needed for the sort interface to replace the Version objects at two different positions in the slice.

type NamedItem

type NamedItem struct {
	Name string `cty:"name"`
}

NamedItem is a struct used by benchmark, container and dashboard to specify children of different types

func (NamedItem) String

func (c NamedItem) String() string

type NamedItemList

type NamedItemList []NamedItem

func (NamedItemList) StringList

func (l NamedItemList) StringList() []string

type NodeAndEdgeProvider added in v0.19.0

type NodeAndEdgeProvider interface {
	QueryProvider
	WithProvider
	GetEdges() DashboardEdgeList
	SetEdges(DashboardEdgeList)
	GetNodes() DashboardNodeList
	SetNodes(DashboardNodeList)
	AddCategory(category *DashboardCategory) hcl.Diagnostics
	AddChild(child HclResource) hcl.Diagnostics
}

NodeAndEdgeProvider must be implemented by any dashboard leaf node which supports edges and nodes (DashboardGraph, DashboardFlow, DashboardHierarchy) TODO [node_reuse] add NodeAndEdgeProviderImpl https://github.com/turbot/steampipe/issues/2918

type NodePath

type NodePath []string

NodePath is a string array representing the parentage of a ModTreeItem

type OpenGraph

type OpenGraph struct {
	// The opengraph description (og:description) of the mod, for use in social media applications
	Description *string `cty:"description" hcl:"description" json:"description"`
	// The opengraph display title (og:title) of the mod, for use in social media applications.
	Title     *string   `cty:"title" hcl:"title" json:"title"`
	Image     *string   `cty:"image" hcl:"image" json:"image"`
	DeclRange hcl.Range `json:"-"`
}

OpenGraph is a struct representing the OpenGraph group mod resource

type ParamDef

type ParamDef struct {
	ShortName       string  `cty:"name" json:"name"`
	UnqualifiedName string  `cty:"full_name" json:"-"`
	Description     *string `cty:"description" json:"description"`
	Default         *string `cty:"default" json:"default"`
	// tactical - is the raw value a string
	IsString bool `cty:"is_string" json:"-"`

	// list of all blocks referenced by the resource
	References []*ResourceReference `json:"-"`
	DeclRange  hcl.Range            `json:"-"`
}

func NewParamDef

func NewParamDef(block *hcl.Block) *ParamDef

func (*ParamDef) Equals

func (p *ParamDef) Equals(other *ParamDef) bool

func (*ParamDef) GetDefault added in v0.19.0

func (p *ParamDef) GetDefault() (any, error)

GetDefault returns the default as an interface{}, unmarshalling json is the underlying value was NOT a string

func (*ParamDef) SetDefault added in v0.19.0

func (p *ParamDef) SetDefault(value interface{}) error

SetDefault sets the default as a atring points, marshalling to json is the underlying value is NOT a string

func (*ParamDef) String

func (p *ParamDef) String() string

type ParsedPropertyPath

type ParsedPropertyPath struct {
	Mod          string
	ItemType     string
	Name         string
	PropertyPath []string
	// optional scope of this property path ("self")
	Scope    string
	Original string
}

func ParseResourcePropertyPath

func ParseResourcePropertyPath(propertyPath string) (*ParsedPropertyPath, error)

func (*ParsedPropertyPath) PropertyPathString

func (p *ParsedPropertyPath) PropertyPathString() string

func (*ParsedPropertyPath) String

func (p *ParsedPropertyPath) String() string

func (*ParsedPropertyPath) ToParsedResourceName

func (p *ParsedPropertyPath) ToParsedResourceName() *ParsedResourceName

func (*ParsedPropertyPath) ToResourceName

func (p *ParsedPropertyPath) ToResourceName() string

type ParsedResourceName

type ParsedResourceName struct {
	Mod      string
	ItemType string
	Name     string
}

func ParseResourceName

func ParseResourceName(fullName string) (res *ParsedResourceName, err error)

func (*ParsedResourceName) ToFullName added in v0.17.0

func (p *ParsedResourceName) ToFullName() string

func (*ParsedResourceName) ToFullNameWithMod added in v0.17.0

func (p *ParsedResourceName) ToFullNameWithMod(mod string) string

func (*ParsedResourceName) ToResourceName

func (p *ParsedResourceName) ToResourceName() string

type PluginVersion

type PluginVersion struct {
	// the plugin name, as specified in the mod requires block. , e.g. turbot/mod1, aws
	RawName string `cty:"name" hcl:"name,label"`
	// the version STREAM, can be either a major or minor version stream i.e. 1 or 1.1
	VersionString string `cty:"version" hcl:"version,optional"`
	Version       *semver.Version
	// the org and name which are parsed from the raw name
	Org       string
	Name      string
	DeclRange hcl.Range `json:"-"`
}

func (*PluginVersion) FullName

func (p *PluginVersion) FullName() string

func (*PluginVersion) Initialise

func (p *PluginVersion) Initialise() hcl.Diagnostics

Initialise parses the version and name properties

func (*PluginVersion) ShortName

func (p *PluginVersion) ShortName() string

func (*PluginVersion) String

func (p *PluginVersion) String() string

type Pos

type Pos struct {
	Line   int `json:"line"`
	Column int `json:"column"`
	Byte   int `json:"byte"`
}

Pos represents a single position in a source file This is a direct re-implementation of hcl.Pos, allowing us to control JSON serialization

func NewPos

func NewPos(sourcePos hcl.Pos) Pos

func (Pos) GetLegacy

func (r Pos) GetLegacy() hcl.Pos

type Query

type Query struct {
	ResourceWithMetadataImpl
	QueryProviderImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	// only here as otherwise gocty.ImpliedType panics
	Unused string `cty:"unused" json:"-"`
}

Query is a struct representing the Query resource

func (*Query) CtyValue

func (q *Query) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*Query) Diff

func (q *Query) Diff(other *Query) *DashboardTreeItemDiffs

func (*Query) Equals

func (q *Query) Equals(other *Query) bool

func (*Query) InitialiseFromFile

func (q *Query) InitialiseFromFile(modPath, filePath string) (MappableResource, []byte, error)

InitialiseFromFile implements MappableResource

func (*Query) OnDecoded

func (q *Query) OnDecoded(*hcl.Block, ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

func (*Query) String

func (q *Query) String() string

type QueryArgs

type QueryArgs struct {
	ArgMap map[string]string `cty:"args" json:"args,omitempty"`
	// args list may be sparsely populated (in case of runtime dependencies)
	// so use *string
	ArgList    []*string            `cty:"args_list" json:"args_list"`
	References []*ResourceReference `cty:"refs" json:"refs"`
	// contains filtered or unexported fields
}

QueryArgs is a struct which contains the arguments used to invoke a prepared statement these may either be passed by name, in a map, or as a list of positional args NOTE: if both are present the named parameters are used

func MergeArgs

func MergeArgs(queryProvider QueryProvider, runtimeArgs *QueryArgs) (*QueryArgs, error)

MergeArgs ensures base and runtime args are non nil and merges them into single args

func NewQueryArgs

func NewQueryArgs() *QueryArgs

func (*QueryArgs) ArgsStringList

func (q *QueryArgs) ArgsStringList() []string

ArgsStringList convert ArgLists into list of strings

func (*QueryArgs) ConvertArgsList added in v0.19.0

func (q *QueryArgs) ConvertArgsList() ([]any, error)

ConvertArgsList convert argList into list of interface{} by unmarshalling

func (*QueryArgs) Empty

func (q *QueryArgs) Empty() bool

func (*QueryArgs) Equals

func (q *QueryArgs) Equals(other *QueryArgs) bool

func (*QueryArgs) GetNamedArg added in v0.19.0

func (q *QueryArgs) GetNamedArg(name string) (interface{}, bool, error)

func (*QueryArgs) GetPositionalArg added in v0.19.0

func (q *QueryArgs) GetPositionalArg(idx int) (interface{}, bool, error)

func (*QueryArgs) Merge

func (q *QueryArgs) Merge(other *QueryArgs, source QueryProvider) (*QueryArgs, error)

Merge merges the other args with ourselves, creating and returning a new QueryArgs with the result NOTE: other has precedence

func (*QueryArgs) SetArgList added in v0.19.0

func (q *QueryArgs) SetArgList(argList []any) error

func (*QueryArgs) SetArgMap added in v0.19.0

func (q *QueryArgs) SetArgMap(argMap map[string]any) error

func (*QueryArgs) SetNamedArgVal added in v0.19.0

func (q *QueryArgs) SetNamedArgVal(value any, name string) (err error)

func (*QueryArgs) SetPositionalArgVal added in v0.19.0

func (q *QueryArgs) SetPositionalArgVal(value any, idx int) (err error)

func (*QueryArgs) String

func (q *QueryArgs) String() string

func (*QueryArgs) ToString added in v0.19.0

func (q *QueryArgs) ToString(value any) (string, error)

func (*QueryArgs) Validate

func (q *QueryArgs) Validate() error

type QueryProvider

type QueryProvider interface {
	RuntimeDependencyProvider
	GetArgs() *QueryArgs
	GetParams() []*ParamDef
	GetSQL() *string
	GetQuery() *Query
	SetArgs(*QueryArgs)
	SetParams([]*ParamDef)
	GetResolvedQuery(*QueryArgs) (*ResolvedQuery, error)
	RequiresExecution(QueryProvider) bool
	ValidateQuery() hcl.Diagnostics
	MergeParentArgs(QueryProvider, QueryProvider) hcl.Diagnostics
	GetQueryProviderImpl() *QueryProviderImpl
	ParamsInheritedFromBase() bool
	ArgsInheritedFromBase() bool
}

QueryProvider must be implemented by resources which supports prepared statements, i.e. Control and Query

type QueryProviderImpl added in v0.19.0

type QueryProviderImpl struct {
	RuntimeDependencyProviderImpl
	QueryProviderRemain hcl.Body `hcl:",remain" json:"-"`

	SQL    *string     `cty:"sql" hcl:"sql" column:"sql,text" json:"-"`
	Query  *Query      `cty:"query" hcl:"query" json:"-"`
	Args   *QueryArgs  `cty:"args" column:"args,jsonb" json:"-"`
	Params []*ParamDef `cty:"params" column:"params,jsonb" json:"-"`
	// contains filtered or unexported fields
}

func (*QueryProviderImpl) ArgsInheritedFromBase added in v0.19.0

func (q *QueryProviderImpl) ArgsInheritedFromBase() bool

ArgsInheritedFromBase implements QueryProvider determine whether our args were inherited from base resource

func (*QueryProviderImpl) CtyValue added in v0.19.0

func (q *QueryProviderImpl) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*QueryProviderImpl) GetArgs added in v0.19.0

func (q *QueryProviderImpl) GetArgs() *QueryArgs

GetArgs implements QueryProvider

func (*QueryProviderImpl) GetParams added in v0.19.0

func (q *QueryProviderImpl) GetParams() []*ParamDef

GetParams implements QueryProvider

func (*QueryProviderImpl) GetQuery added in v0.19.0

func (q *QueryProviderImpl) GetQuery() *Query

GetQuery implements QueryProvider

func (*QueryProviderImpl) GetQueryProviderImpl added in v0.19.0

func (q *QueryProviderImpl) GetQueryProviderImpl() *QueryProviderImpl

GetQueryProviderImpl implements QueryProvider

func (*QueryProviderImpl) GetResolvedQuery added in v0.19.0

func (q *QueryProviderImpl) GetResolvedQuery(runtimeArgs *QueryArgs) (*ResolvedQuery, error)

GetResolvedQuery return the SQL and args to run the query

func (*QueryProviderImpl) GetSQL added in v0.19.0

func (q *QueryProviderImpl) GetSQL() *string

GetSQL implements QueryProvider

func (*QueryProviderImpl) MergeParentArgs added in v0.19.0

func (q *QueryProviderImpl) MergeParentArgs(queryProvider QueryProvider, parent QueryProvider) (diags hcl.Diagnostics)

MergeParentArgs merges our args with our parent args (ours take precedence)

func (*QueryProviderImpl) ParamsInheritedFromBase added in v0.19.0

func (q *QueryProviderImpl) ParamsInheritedFromBase() bool

ParamsInheritedFromBase implements QueryProvider determine whether our params were inherited from base resource

func (*QueryProviderImpl) RequiresExecution added in v0.19.0

func (q *QueryProviderImpl) RequiresExecution(queryProvider QueryProvider) bool

RequiresExecution implements QueryProvider

func (*QueryProviderImpl) SetArgs added in v0.19.0

func (q *QueryProviderImpl) SetArgs(args *QueryArgs)

SetArgs implements QueryProvider

func (*QueryProviderImpl) SetParams added in v0.19.0

func (q *QueryProviderImpl) SetParams(params []*ParamDef)

SetParams implements QueryProvider

func (*QueryProviderImpl) ValidateQuery added in v0.19.0

func (q *QueryProviderImpl) ValidateQuery() hcl.Diagnostics

ValidateQuery implements QueryProvider returns an error if neither sql or query are set it is overidden by resource types for which sql is optional

type Range

type Range struct {
	// Filename is the name of the file into which this range's positions point.
	Filename string `json:"filename,omitempty"`

	// Start and End represent the bounds of this range. Start is inclusive and End is exclusive.
	Start Pos `json:"start,omitempty"`
	End   Pos `json:"end,omitempty"`
}

Range represents a span of characters between two positions in a source file. This is a direct re-implementation of hcl.Range, allowing us to control JSON serialization

func NewRange

func NewRange(sourceRange hcl.Range) Range

func (Range) GetLegacy

func (r Range) GetLegacy() hcl.Range

type Require

type Require struct {
	SteampipeVersion       *semver.Version
	SteampipeVersionString string           `hcl:"steampipe,optional"`
	Plugins                []*PluginVersion `hcl:"plugin,block"`
	Mods                   []*ModVersionConstraint
	DeclRange              hcl.Range
	// contains filtered or unexported fields
}

Require is a struct representing mod dependencies

func NewRequire

func NewRequire() *Require

func (*Require) AddModDependencies

func (r *Require) AddModDependencies(newModVersions map[string]*ModVersionConstraint)

AddModDependencies adds all the mod in newModVersions to our list of mods, using the following logic - if a mod with same name, [alias] and constraint exists, it is not added - if a mod with same name [and alias] and different constraint exist, it is replaced

func (*Require) ContainsMod

func (r *Require) ContainsMod(requiredModVersion *ModVersionConstraint) bool

func (*Require) Empty

func (r *Require) Empty() bool

func (*Require) GetModDependency

func (r *Require) GetModDependency(name string) *ModVersionConstraint

func (*Require) RemoveAllModDependencies

func (r *Require) RemoveAllModDependencies()

func (*Require) RemoveModDependencies

func (r *Require) RemoveModDependencies(versions map[string]*ModVersionConstraint)

func (*Require) ValidateSteampipeVersion

func (r *Require) ValidateSteampipeVersion(modName string) error

type ResolvedQuery

type ResolvedQuery struct {
	ExecuteSQL string
	RawSQL     string
	Args       []any
}

ResolvedQuery contains the execute SQL, raw SQL and args string used to execute a query

func (ResolvedQuery) QueryArgs added in v0.19.0

func (r ResolvedQuery) QueryArgs() *QueryArgs

QueryArgs converts the ResolvedQuery into QueryArgs

type ResourceDependency

type ResourceDependency struct {
	Range      hcl.Range
	Traversals []hcl.Traversal
}

func (*ResourceDependency) IsRuntimeDependency

func (d *ResourceDependency) IsRuntimeDependency() bool

func (*ResourceDependency) String

func (d *ResourceDependency) String() string

type ResourceMaps added in v0.17.0

type ResourceMaps struct {
	// the parent mod
	Mod *Mod

	// all mods (including deps)
	Benchmarks            map[string]*Benchmark
	Controls              map[string]*Control
	Dashboards            map[string]*Dashboard
	DashboardCategories   map[string]*DashboardCategory
	DashboardCards        map[string]*DashboardCard
	DashboardCharts       map[string]*DashboardChart
	DashboardContainers   map[string]*DashboardContainer
	DashboardEdges        map[string]*DashboardEdge
	DashboardFlows        map[string]*DashboardFlow
	DashboardGraphs       map[string]*DashboardGraph
	DashboardHierarchies  map[string]*DashboardHierarchy
	DashboardImages       map[string]*DashboardImage
	DashboardInputs       map[string]map[string]*DashboardInput
	DashboardTables       map[string]*DashboardTable
	DashboardTexts        map[string]*DashboardText
	DashboardNodes        map[string]*DashboardNode
	GlobalDashboardInputs map[string]*DashboardInput
	Locals                map[string]*Local
	Mods                  map[string]*Mod
	Queries               map[string]*Query
	References            map[string]*ResourceReference
	// map of snapshot paths, keyed by snapshot name
	Snapshots map[string]string
	Variables map[string]*Variable
}

ResourceMaps is a struct containing maps of all mod resource types This is provided to avoid db needing to reference workspace package

func ModResourcesForQueries added in v0.17.0

func ModResourcesForQueries(queryProviders []QueryProvider, mod *Mod) *ResourceMaps

ModResourcesForQueries creates a ResourceMaps object containing just the specified queries This is used to just create necessary prepared statements when executing batch queries

func NewModResources added in v0.17.0

func NewModResources(mod *Mod) *ResourceMaps

func NewSourceSnapshotModResources added in v0.17.0

func NewSourceSnapshotModResources(snapshotPaths []string) *ResourceMaps

func (*ResourceMaps) AddResource added in v0.17.0

func (m *ResourceMaps) AddResource(item HclResource) hcl.Diagnostics

func (*ResourceMaps) AddSnapshots added in v0.17.0

func (m *ResourceMaps) AddSnapshots(snapshotPaths []string)

func (*ResourceMaps) Empty added in v0.17.0

func (m *ResourceMaps) Empty() bool

func (*ResourceMaps) Equals added in v0.17.0

func (m *ResourceMaps) Equals(other *ResourceMaps) bool

func (*ResourceMaps) GetResource added in v0.19.0

func (m *ResourceMaps) GetResource(parsedName *ParsedResourceName) (resource HclResource, found bool)

GetResource tries to find a resource with the given name in the ResourceMaps NOTE: this does NOT support inputs, which are NOT uniquely named in a mod

func (*ResourceMaps) Merge added in v0.17.0

func (m *ResourceMaps) Merge(others []*ResourceMaps) *ResourceMaps

func (*ResourceMaps) PopulateReferences added in v0.17.0

func (m *ResourceMaps) PopulateReferences()

func (*ResourceMaps) QueryProviders added in v0.17.0

func (m *ResourceMaps) QueryProviders() []QueryProvider

QueryProviders returns a slice of all QueryProviders

func (*ResourceMaps) WalkResources added in v0.17.0

func (m *ResourceMaps) WalkResources(resourceFunc func(item HclResource) (bool, error)) error

WalkResources calls resourceFunc for every resource in the mod if any resourceFunc returns false or an error, return immediately

type ResourceMapsProvider added in v0.17.0

type ResourceMapsProvider interface {
	GetResourceMaps() *ResourceMaps
	GetResource(parsedName *ParsedResourceName) (resource HclResource, found bool)
}

type ResourceMetadata

type ResourceMetadata struct {
	ResourceName string `column:"resource_name,text"`
	// mod short name
	ModName          string `column:"mod_name,text"`
	FileName         string `column:"file_name,text"`
	StartLineNumber  int    `column:"start_line_number,integer"`
	EndLineNumber    int    `column:"end_line_number,integer"`
	IsAutoGenerated  bool   `column:"auto_generated,bool"`
	SourceDefinition string `column:"source_definition,text"`
	ModFullName      string
	Anonymous        bool `column:"is_anonymous,bool"`
}

ResourceMetadata ius a struct containing additional data about each resource, used to populate the introspection tables

func (*ResourceMetadata) Clone added in v0.19.0

func (m *ResourceMetadata) Clone() *ResourceMetadata

func (*ResourceMetadata) SetMod

func (m *ResourceMetadata) SetMod(mod *Mod)

SetMod sets the mod name and mod short name

type ResourceReference

type ResourceReference struct {
	ResourceWithMetadataImpl

	To        string `cty:"reference_to" column:"reference_to,text"`
	From      string `cty:"reference_from" column:"reference_from,text"`
	BlockType string `cty:"from_block_type" column:"from_block_type,text"`
	BlockName string `cty:"from_block_name" column:"from_block_name,text"`
	Attribute string `cty:"from_attribute" column:"from_attribute,text"`
	// contains filtered or unexported fields
}

func NewResourceReference added in v0.19.0

func NewResourceReference(resource HclResource, block *hcl.Block, referenceString string, blockName string, attr *hclsyntax.Attribute) *ResourceReference

func (*ResourceReference) CloneWithNewFrom added in v0.19.0

func (r *ResourceReference) CloneWithNewFrom(from string) *ResourceReference

func (*ResourceReference) Equals

func (r *ResourceReference) Equals(other *ResourceReference) bool

func (*ResourceReference) Name

func (r *ResourceReference) Name() string

Name implements ResourceWithMetadata the name must start with the 'resource type' as we parse it and use just the 'name' segment

func (*ResourceReference) String

func (r *ResourceReference) String() string

type ResourceReferenceMap

type ResourceReferenceMap map[string][]*ResourceReference

ResourceReferenceMap is a map of references keyed by 'ref' This is to handle the same reference being made more than once by a resource for example the reference var.v1 might be referenced several times

func (ResourceReferenceMap) Add

func (m ResourceReferenceMap) Add(reference *ResourceReference)

type ResourceWithMetadata

type ResourceWithMetadata interface {
	Name() string
	GetMetadata() *ResourceMetadata
	SetMetadata(metadata *ResourceMetadata)
	SetAnonymous(block *hcl.Block)
	IsAnonymous() bool
	AddReference(ref *ResourceReference)
	GetReferences() []*ResourceReference
}

ResourceWithMetadata must be implemented by resources which supports reflection metadata

type ResourceWithMetadataImpl added in v0.19.0

type ResourceWithMetadataImpl struct {
	// required to allow partial decoding
	ResourceWithMetadataBaseRemain hcl.Body             `hcl:",remain" json:"-"`
	References                     []*ResourceReference `json:"-"`
	// contains filtered or unexported fields
}

func (*ResourceWithMetadataImpl) AddReference added in v0.19.0

func (b *ResourceWithMetadataImpl) AddReference(ref *ResourceReference)

AddReference implements ResourceWithMetadata

func (*ResourceWithMetadataImpl) GetMetadata added in v0.19.0

func (b *ResourceWithMetadataImpl) GetMetadata() *ResourceMetadata

GetMetadata implements ResourceWithMetadata

func (*ResourceWithMetadataImpl) GetReferences added in v0.19.0

func (b *ResourceWithMetadataImpl) GetReferences() []*ResourceReference

GetReferences implements ResourceWithMetadata

func (*ResourceWithMetadataImpl) IsAnonymous added in v0.19.0

func (b *ResourceWithMetadataImpl) IsAnonymous() bool

IsAnonymous implements ResourceWithMetadata

func (*ResourceWithMetadataImpl) SetAnonymous added in v0.19.0

func (b *ResourceWithMetadataImpl) SetAnonymous(block *hcl.Block)

SetAnonymous implements ResourceWithMetadata

func (*ResourceWithMetadataImpl) SetMetadata added in v0.19.0

func (b *ResourceWithMetadataImpl) SetMetadata(metadata *ResourceMetadata)

SetMetadata implements ResourceWithMetadata

type RuntimeDependency

type RuntimeDependency struct {
	PropertyPath       *ParsedPropertyPath
	TargetPropertyName *string
	// TACTICAL the name of the parent property - either "args" or "param.<name>"
	ParentPropertyName  string
	TargetPropertyIndex *int

	// TACTICAL - if set, wrap the dependency value in an array
	// this provides support for args which convert a runtime dependency to an array, like:
	// arns = [input.arn]
	IsArray bool

	// resource which provides has the dependency
	Provider HclResource
}

func (*RuntimeDependency) Equals

func (d *RuntimeDependency) Equals(other *RuntimeDependency) bool

func (*RuntimeDependency) SourceResourceName added in v0.19.0

func (d *RuntimeDependency) SourceResourceName() string

func (*RuntimeDependency) String

func (d *RuntimeDependency) String() string

func (*RuntimeDependency) ValidateSource added in v0.19.0

func (d *RuntimeDependency) ValidateSource(dashboard *Dashboard, workspace ResourceMapsProvider) error

type RuntimeDependencyProvider added in v0.19.0

type RuntimeDependencyProvider interface {
	ModTreeItem
	AddRuntimeDependencies([]*RuntimeDependency)
	GetRuntimeDependencies() map[string]*RuntimeDependency
}

RuntimeDependencyProvider is implemented by all QueryProviders and Dashboard

type RuntimeDependencyProviderImpl added in v0.19.0

type RuntimeDependencyProviderImpl struct {
	ModTreeItemImpl
	// required to allow partial decoding
	RuntimeDependencyProviderRemain hcl.Body `hcl:",remain" json:"-"`
	// contains filtered or unexported fields
}

func (*RuntimeDependencyProviderImpl) AddRuntimeDependencies added in v0.19.0

func (b *RuntimeDependencyProviderImpl) AddRuntimeDependencies(dependencies []*RuntimeDependency)

func (*RuntimeDependencyProviderImpl) GetRuntimeDependencies added in v0.19.0

func (b *RuntimeDependencyProviderImpl) GetRuntimeDependencies() map[string]*RuntimeDependency

type Variable

type Variable struct {
	ResourceWithMetadataImpl
	ModTreeItemImpl

	// required to allow partial decoding
	Remain hcl.Body `hcl:",remain" json:"-"`

	Default cty.Value `column:"default_value,jsonb" json:"-"`
	Type    cty.Type  `column:"var_type,text" json:"-"`

	TypeString string      `json:"type"`
	DefaultGo  interface{} `json:"value_default"`
	ValueGo    interface{} `json:"value"`
	ModName    string      `json:"mod_name"`

	// set after value resolution `column:"value,jsonb"`
	Value                      cty.Value                      `column:"value,jsonb" json:"-"`
	ValueSourceType            string                         `column:"value_source,text" json:"-"`
	ValueSourceFileName        string                         `column:"value_source_file_name,text" json:"-"`
	ValueSourceStartLineNumber int                            `column:"value_source_start_line_number,integer" json:"-"`
	ValueSourceEndLineNumber   int                            `column:"value_source_end_line_number,integer" json:"-"`
	ParsingMode                var_config.VariableParsingMode `json:"-"`
	// contains filtered or unexported fields
}

Variable is a struct representing a Variable resource

func NewVariable

func NewVariable(v *var_config.Variable, mod *Mod) *Variable

func (*Variable) CtyValue

func (v *Variable) CtyValue() (cty.Value, error)

CtyValue implements CtyValueProvider

func (*Variable) Diff

func (v *Variable) Diff(other *Variable) *DashboardTreeItemDiffs

func (*Variable) Equals

func (v *Variable) Equals(other *Variable) bool

func (*Variable) OnDecoded

func (v *Variable) OnDecoded(block *hcl.Block, resourceMapProvider ResourceMapsProvider) hcl.Diagnostics

OnDecoded implements HclResource

func (*Variable) Required

func (v *Variable) Required() bool

Required returns true if this variable is required to be set by the caller, or false if there is a default value that will be used when it isn't set.

func (*Variable) SetInputValue

func (v *Variable) SetInputValue(value cty.Value, sourceType string, sourceRange tfdiags.SourceRange) error

type VariableValidationFailedError

type VariableValidationFailedError struct {
}

func (VariableValidationFailedError) Error

type VersionConstrainCollection

type VersionConstrainCollection []*ModVersionConstraint

type WithProvider added in v0.19.0

type WithProvider interface {
	AddWith(with *DashboardWith) hcl.Diagnostics
	GetWiths() []*DashboardWith
	GetWith(string) (*DashboardWith, bool)
}

type WithProviderImpl added in v0.19.0

type WithProviderImpl struct {
	// required to allow partial decoding
	WithProviderRemain hcl.Body `hcl:",remain" json:"-"`
	// contains filtered or unexported fields
}

func (*WithProviderImpl) AddWith added in v0.19.0

func (b *WithProviderImpl) AddWith(with *DashboardWith) hcl.Diagnostics

func (*WithProviderImpl) GetWith added in v0.19.0

func (b *WithProviderImpl) GetWith(name string) (*DashboardWith, bool)

func (*WithProviderImpl) GetWiths added in v0.19.0

func (b *WithProviderImpl) GetWiths() []*DashboardWith

type WorkspaceProfile added in v0.17.0

type WorkspaceProfile struct {
	ProfileName       string            `hcl:"name,label" cty:"name"`
	CloudHost         *string           `hcl:"cloud_host,optional" cty:"cloud_host"`
	CloudToken        *string           `hcl:"cloud_token,optional" cty:"cloud_token"`
	InstallDir        *string           `hcl:"install_dir,optional" cty:"install_dir"`
	ModLocation       *string           `hcl:"mod_location,optional" cty:"mod_location"`
	SnapshotLocation  *string           `hcl:"snapshot_location,optional" cty:"snapshot_location"`
	WorkspaceDatabase *string           `hcl:"workspace_database,optional" cty:"workspace_database"`
	QueryTimeout      *int              `hcl:"query_timeout,optional" cty:"query_timeout"`
	Base              *WorkspaceProfile `hcl:"base"`

	// options
	GeneralOptions    *options.General
	TerminalOptions   *options.Terminal
	ConnectionOptions *options.Connection
	DeclRange         hcl.Range
}

func NewWorkspaceProfile added in v0.17.0

func NewWorkspaceProfile(block *hcl.Block) *WorkspaceProfile

func (*WorkspaceProfile) ConfigMap added in v0.17.0

func (p *WorkspaceProfile) ConfigMap() map[string]interface{}

ConfigMap creates a config map containing all options to pass to viper

func (*WorkspaceProfile) CtyValue added in v0.17.0

func (p *WorkspaceProfile) CtyValue() (cty.Value, error)

func (*WorkspaceProfile) Name added in v0.17.0

func (p *WorkspaceProfile) Name() string

func (*WorkspaceProfile) OnDecoded added in v0.17.0

func (p *WorkspaceProfile) OnDecoded() hcl.Diagnostics

func (*WorkspaceProfile) SetOptions added in v0.17.0

func (p *WorkspaceProfile) SetOptions(opts options.Options, block *hcl.Block) hcl.Diagnostics

SetOptions sets the options on the connection verify the options object is a valid options type (only options.Connection currently supported)

type WorkspaceResources

type WorkspaceResources struct {
	Query     map[string]bool
	Control   map[string]bool
	Benchmark map[string]bool
}

WorkspaceResources is used exclusively for the query/check command completion TODO to be refactored

func NewWorkspaceResources

func NewWorkspaceResources() *WorkspaceResources

func (*WorkspaceResources) GetSortedBenchmarksAndControlNames

func (w *WorkspaceResources) GetSortedBenchmarksAndControlNames() []string

GetSortedBenchmarksAndControlNames gives back a list of the benchmarks and controls in the current workspace. The list is sorted alphabetically - with the benchmarks first

func (*WorkspaceResources) GetSortedNamedQueryNames

func (w *WorkspaceResources) GetSortedNamedQueryNames() []string

func (*WorkspaceResources) Merge

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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