solution

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDeploymentDependenciesFromVal

func AddDeploymentDependenciesFromVal(
	ctx Solution,
	resource *construct.Resource,
	val any,
) error

func DownstreamFunctional

func DownstreamFunctional(sol Solution, resource construct.ResourceId) ([]construct.ResourceId, error)

func GetResourcesFromPropertyReference

func GetResourcesFromPropertyReference(
	ctx Solution,
	resource construct.ResourceId,
	propertyRef string,
) (
	resources []construct.ResourceId,
	errs error,
)

getResourcesFromPropertyReference takes a property reference and returns all the resources that are referenced by it. It does this by walking the property reference (split by #) and finding all the resources that are in the property.

func IsOperationalResourceSideEffect

func IsOperationalResourceSideEffect(sol Solution, rid, sideEffect construct.ResourceId) (bool, error)

func Upstream

func Upstream(
	sol Solution,
	resource construct.ResourceId,
	layer knowledgebase.DependencyLayer,
) ([]construct.ResourceId, error)

func UpstreamFunctional

func UpstreamFunctional(sol Solution, resource construct.ResourceId) ([]construct.ResourceId, error)

Types

type AddDependencyDecision

type AddDependencyDecision struct {
	From construct.ResourceId
	To   construct.ResourceId
}

type AddResourceDecision

type AddResourceDecision struct {
	Resource construct.ResourceId
}

type AsEngineError

type AsEngineError interface {
	// TryEngineError returns an EngineError if the decision is an error, otherwise nil.
	TryEngineError() engine_errs.EngineError
}

type ConfigValidationError

type ConfigValidationError struct {
	PropertyValidationDecision
}

func (ConfigValidationError) Error

func (e ConfigValidationError) Error() string

func (ConfigValidationError) ErrorCode

func (ConfigValidationError) ToJSONMap

func (e ConfigValidationError) ToJSONMap() map[string]any

func (ConfigValidationError) Unwrap

func (e ConfigValidationError) Unwrap() error

type Configurer

type Configurer struct {
	Ctx Solution
}

func (*Configurer) ConfigureResource

func (c *Configurer) ConfigureResource(
	resource *construct.Resource,
	configuration knowledgebase.Configuration,
	data knowledgebase.DynamicValueData,
	action constraints.ConstraintOperator,
	userInitiated bool,
) error

type DecisionRecords

type DecisionRecords struct {
	// contains filtered or unexported fields
}

func (*DecisionRecords) GetDecisions

func (r *DecisionRecords) GetDecisions() []SolveDecision

func (*DecisionRecords) RecordDecision

func (r *DecisionRecords) RecordDecision(d SolveDecision)

type OperationalView

type OperationalView interface {
	construct.Graph

	MakeResourcesOperational(resources []*construct.Resource) error
	UpdateResourceID(oldId, newId construct.ResourceId) error
	MakeEdgesOperational(edges []construct.Edge) error
}

type PropertyValidationDecision

type PropertyValidationDecision struct {
	Resource construct.ResourceId
	Property knowledgebase.Property
	Value    any
	Error    error
}

func (PropertyValidationDecision) TryEngineError

type RawAccessView

type RawAccessView struct {
	// contains filtered or unexported fields
}

func NewRawView

func NewRawView(inner Solution) RawAccessView

func (RawAccessView) AddEdge

func (view RawAccessView) AddEdge(source, target construct.ResourceId, options ...func(*graph.EdgeProperties)) error

func (RawAccessView) AddEdgesFrom

func (view RawAccessView) AddEdgesFrom(g construct.Graph) error

func (RawAccessView) AddVertex

func (view RawAccessView) AddVertex(value *construct.Resource, options ...func(*graph.VertexProperties)) error

func (RawAccessView) AddVerticesFrom

func (view RawAccessView) AddVerticesFrom(g construct.Graph) error

func (RawAccessView) AdjacencyMap

func (view RawAccessView) AdjacencyMap() (map[construct.ResourceId]map[construct.ResourceId]construct.Edge, error)

func (RawAccessView) Clone

func (view RawAccessView) Clone() (construct.Graph, error)

func (RawAccessView) Edge

func (view RawAccessView) Edge(source, target construct.ResourceId) (construct.ResourceEdge, error)

func (RawAccessView) Edges

func (view RawAccessView) Edges() ([]construct.Edge, error)

func (RawAccessView) Order

func (view RawAccessView) Order() (int, error)

func (RawAccessView) PredecessorMap

func (view RawAccessView) PredecessorMap() (map[construct.ResourceId]map[construct.ResourceId]construct.Edge, error)

func (RawAccessView) RemoveEdge

func (view RawAccessView) RemoveEdge(source, target construct.ResourceId) error

func (RawAccessView) RemoveVertex

func (view RawAccessView) RemoveVertex(hash construct.ResourceId) error

func (RawAccessView) Size

func (view RawAccessView) Size() (int, error)

func (RawAccessView) Traits

func (view RawAccessView) Traits() *graph.Traits

func (RawAccessView) UpdateEdge

func (view RawAccessView) UpdateEdge(
	source, target construct.ResourceId,
	options ...func(properties *graph.EdgeProperties),
) error

func (RawAccessView) Vertex

func (view RawAccessView) Vertex(hash construct.ResourceId) (*construct.Resource, error)

func (RawAccessView) VertexWithProperties

func (view RawAccessView) VertexWithProperties(
	hash construct.ResourceId,
) (*construct.Resource, graph.VertexProperties, error)

type RemoveDependencyDecision

type RemoveDependencyDecision struct {
	From construct.ResourceId
	To   construct.ResourceId
}

type RemoveResourceDecision

type RemoveResourceDecision struct {
	Resource construct.ResourceId
}

type ResourceConfigurer

type ResourceConfigurer interface {
	ConfigureResource(
		resource *construct.Resource,
		configuration knowledgebase.Configuration,
		data knowledgebase.DynamicValueData,
		action constraints.ConstraintOperator,
		userInitiated bool,
	) error
}

type SetPropertyDecision

type SetPropertyDecision struct {
	Resource construct.ResourceId
	Property string
	Value    any
}

type Solution

type Solution interface {
	Context() context.Context

	KnowledgeBase() knowledgebase.TemplateKB
	Constraints() *constraints.Constraints

	RecordDecision(d SolveDecision)
	GetDecisions() []SolveDecision

	DataflowGraph() construct.Graph
	DeploymentGraph() construct.Graph

	// OperationalView returns a graph that makes any resources or edges added operational as part of the operation.
	// Read operations come from the Dataflow graph.
	// Write operations will update both the Dataflow and Deployment graphs.
	OperationalView() OperationalView
	// RawView returns a graph that makes no changes beyond explicitly requested operations.
	// Read operations come from the Dataflow graph.
	// Write operations will update both the Dataflow and Deployment graphs.
	RawView() construct.Graph
	// GlobalTag returns the global tag for the solution context
	GlobalTag() string
	Outputs() map[string]construct.Output
}

type SolveDecision

type SolveDecision interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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