terraform/terraform/eval_validate.go

41 lines
876 B
Go
Raw Normal View History

2015-02-05 00:44:23 +01:00
package terraform
import (
"fmt"
"github.com/hashicorp/terraform/config"
)
// EvalValidateError is the error structure returned if there were
// validation errors.
type EvalValidateError struct {
Warnings []string
Errors []error
}
func (e *EvalValidateError) Error() string {
return ""
}
// EvalValidateResource is an EvalNode implementation that validates
// the configuration of a resource.
type EvalValidateResource struct {
Provider EvalNode
Config *config.RawConfig
}
func (n *EvalValidateResource) Args() ([]EvalNode, []EvalType) {
return []EvalNode{n.Provider},
[]EvalType{EvalTypeResourceProvider}
}
func (n *EvalValidateResource) Eval(
ctx EvalContext, args []interface{}) (interface{}, error) {
//provider := args[0].(ResourceProvider)
return nil, fmt.Errorf("WHAT")
}
func (n *EvalValidateResource) Type() EvalType {
return EvalTypeNull
}