Documentation ¶
Index ¶
- func PrintGraph(g Graph)
- func UpdateEdgeId(e construct.SimpleEdge, oldId, newId construct.ResourceId) construct.SimpleEdge
- type EnqueueErrors
- type Evaluator
- func (eval *Evaluator) AddEdges(es ...construct.Edge) error
- func (eval *Evaluator) AddResources(rs ...*construct.Resource) error
- func (eval *Evaluator) Evaluate() error
- func (eval *Evaluator) EvalutedOrder() [][]Key
- func (eval *Evaluator) Log() *zap.SugaredLogger
- func (eval *Evaluator) RecalculateUnevaluated() error
- func (eval *Evaluator) RemoveEdge(source, target construct.ResourceId) error
- func (eval *Evaluator) RemoveResource(id construct.ResourceId) error
- func (eval *Evaluator) UpdateId(oldId, newId construct.ResourceId) error
- type Graph
- type Key
- type ReadyPriority
- type Vertex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintGraph ¶
func PrintGraph(g Graph)
func UpdateEdgeId ¶
func UpdateEdgeId(e construct.SimpleEdge, oldId, newId construct.ResourceId) construct.SimpleEdge
Types ¶
type EnqueueErrors ¶
func (*EnqueueErrors) Append ¶
func (e *EnqueueErrors) Append(key Key, err error)
func (EnqueueErrors) Error ¶
func (e EnqueueErrors) Error() string
func (EnqueueErrors) Unwrap ¶
func (e EnqueueErrors) Unwrap() []error
type Evaluator ¶
func NewEvaluator ¶
func (*Evaluator) AddResources ¶
func (*Evaluator) EvalutedOrder ¶
func (*Evaluator) Log ¶
func (eval *Evaluator) Log() *zap.SugaredLogger
func (*Evaluator) RecalculateUnevaluated ¶
RecalculateUnevaluated is used to recalculate the dependencies of all the unevaluated vertices in case some parts have "opened up" due to the evaluation of other vertices via template `{{ if }}` conditions or chained dependencies (eg `{{ fieldValue "X" (fieldValue "SomeRef" .Self) }}`, the dependency of X won't be able to be resolved until SomeRef is evaluated). There is likely a way to determine which vertices need to be recalculated, but the runtime impact of just recalculating them all isn't large at the size of graphs we're currently running with.
func (*Evaluator) RemoveEdge ¶
func (eval *Evaluator) RemoveEdge(source, target construct.ResourceId) error
func (*Evaluator) RemoveResource ¶
func (eval *Evaluator) RemoveResource(id construct.ResourceId) error
RemoveResource removes all edges from the resource. any property references (as [ResourceId] or [PropertyRef]) to the resource, and finally the resource itself.
type Key ¶
type Key struct { Ref construct.PropertyRef RuleHash string Edge construct.SimpleEdge GraphState graphStateRepr PathSatisfication knowledgebase.EdgePathSatisfaction }
type ReadyPriority ¶
type ReadyPriority int
const ( // ReadyNow indicates the vertex is ready to be evaluated ReadyNow ReadyPriority = iota // NotReadyLow is used when it's relatively certain that the vertex will be ready, but cannot be 100% certain. NotReadyLow // NotReadyMid is for cases which don't clearly fit in [NotReadyLow] or [NotReadyHigh] NotReadyMid // NotReadyHigh is used for verticies which can almost never be 100% certain that they're correct based on the // current state. NotReadyHigh // NotReadyMax it reserved for when running the vertex would likely cause an error, rather than incorrect behaviour NotReadyMax )
func (ReadyPriority) String ¶
func (r ReadyPriority) String() string