terraform/terraform/eval_sequence.go

24 lines
459 B
Go
Raw Normal View History

2015-02-05 02:23:26 +01:00
package terraform
// EvalSequence is an EvalNode that evaluates in sequence.
type EvalSequence struct {
Nodes []EvalNode
}
2015-02-14 07:58:41 +01:00
func (n *EvalSequence) Eval(ctx EvalContext) (interface{}, error) {
for _, n := range n.Nodes {
if _, err := EvalRaw(n, ctx); err != nil {
return nil, err
}
2015-02-05 02:23:26 +01:00
}
2015-02-14 07:58:41 +01:00
return nil, nil
2015-02-05 02:23:26 +01:00
}
2015-02-11 17:48:45 +01:00
// EvalNodeFilterable impl.
func (n *EvalSequence) Filter(fn EvalNodeFilterFunc) {
for i, node := range n.Nodes {
n.Nodes[i] = fn(node)
}
}