operational_rule

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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildUndirectedGraph

func BuildUndirectedGraph(ctx solution.Solution) (construct.Graph, error)

func EvaluateIfCondition

func EvaluateIfCondition(
	tmplString string,
	sol solution.Solution,
	data knowledgebase.DynamicValueData,
) (bool, error)

func ForceRemoveDependency

func ForceRemoveDependency(
	res1, res2 construct.ResourceId,
	sol solution.Solution,
) error

Types

type ClosestPlacer

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

func (ClosestPlacer) PlaceResources

func (p ClosestPlacer) PlaceResources(
	resource *construct.Resource,
	step knowledgebase.OperationalStep,
	availableResources []*construct.Resource,
	numNeeded *int,
) error

func (*ClosestPlacer) SetCtx

func (p *ClosestPlacer) SetCtx(ctx OperationalRuleContext)

type ClusterPlacer

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

func (*ClusterPlacer) PlaceResources

func (p *ClusterPlacer) PlaceResources(
	resource *construct.Resource,
	step knowledgebase.OperationalStep,
	availableResources []*construct.Resource,
	numNeeded *int,
) error

func (*ClusterPlacer) SetCtx

func (p *ClusterPlacer) SetCtx(ctx OperationalRuleContext)

type OpRuleHandler

type OpRuleHandler interface {
	HandleOperationalRule(rule knowledgebase.OperationalRule, configurationOperator constraints.ConstraintOperator) error
	HandlePropertyRule(rule knowledgebase.PropertyRule) error
	SetData(data knowledgebase.DynamicValueData)
}

type OperationalRuleContext

type OperationalRuleContext struct {
	Solution solution.Solution
	Property knowledgebase.Property
	Data     knowledgebase.DynamicValueData
}

func (OperationalRuleContext) CleanProperty

CleanProperty clears the property associated with the rule if it no longer matches the rule. For array properties, each element must match at least one step selector and non-matching elements will be removed.

func (OperationalRuleContext) HandleConfigurationRule

func (ctx OperationalRuleContext) HandleConfigurationRule(
	config knowledgebase.ConfigurationRule,
	configurationOperator constraints.ConstraintOperator,
) error

func (*OperationalRuleContext) HandleOperationalRule

func (ctx *OperationalRuleContext) HandleOperationalRule(
	rule knowledgebase.OperationalRule,
	configurationOperator constraints.ConstraintOperator,
) error

func (OperationalRuleContext) HandleOperationalStep

func (ctx OperationalRuleContext) HandleOperationalStep(step knowledgebase.OperationalStep) error

func (*OperationalRuleContext) HandlePropertyRule

func (ctx *OperationalRuleContext) HandlePropertyRule(rule knowledgebase.PropertyRule) error

func (*OperationalRuleContext) SetData

func (OperationalRuleContext) SetField

func (ctx OperationalRuleContext) SetField(resource, fieldResource *construct.Resource, step knowledgebase.OperationalStep) error

type ResourcePlacer

type ResourcePlacer interface {
	PlaceResources(
		resource *construct.Resource,
		step knowledgebase.OperationalStep,
		availableResources []*construct.Resource,
		numNeeded *int,
	) error

	SetCtx(ctx OperationalRuleContext)
}

type SpreadPlacer

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

func (*SpreadPlacer) PlaceResources

func (p *SpreadPlacer) PlaceResources(
	resource *construct.Resource,
	step knowledgebase.OperationalStep,
	availableResources []*construct.Resource,
	numNeeded *int,
) error

func (*SpreadPlacer) SetCtx

func (p *SpreadPlacer) SetCtx(ctx OperationalRuleContext)

Jump to

Keyboard shortcuts

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