mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-15 11:13:09 -06:00
25 lines
816 B
Go
25 lines
816 B
Go
package terraform
|
|
|
|
// EvalNode is the interface that must be implemented by graph nodes to
|
|
// evaluate/execute.
|
|
type EvalNode interface {
|
|
// Args returns the arguments for this node as well as the list of
|
|
// expected types. The expected types are only used for type checking
|
|
// and not used at runtime.
|
|
Args() ([]EvalNode, []EvalType)
|
|
|
|
// Eval evaluates this node with the given context. The second parameter
|
|
// are the argument values. These will match in order and 1-1 with the
|
|
// results of the Args() return value.
|
|
Eval(EvalContext, []interface{}) (interface{}, error)
|
|
|
|
// Type returns the type that will be returned by this node.
|
|
Type() EvalType
|
|
}
|
|
|
|
// GraphNodeEvalable is the interface that graph nodes must implement
|
|
// to enable valuation.
|
|
type GraphNodeEvalable interface {
|
|
EvalTree() EvalNode
|
|
}
|