mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-29 10:21:01 -06:00
36d0a50427
This is part of a general effort to move all of Terraform's non-library package surface under internal in order to reinforce that these are for internal use within Terraform only. If you were previously importing packages under this prefix into an external codebase, you could pin to an earlier release tag as an interim solution until you've make a plan to achieve the same functionality some other way.
26 lines
1.1 KiB
Go
26 lines
1.1 KiB
Go
package terraform
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform/internal/addrs"
|
|
"github.com/hashicorp/terraform/internal/tfdiags"
|
|
)
|
|
|
|
// GraphWalker is an interface that can be implemented that when used
|
|
// with Graph.Walk will invoke the given callbacks under certain events.
|
|
type GraphWalker interface {
|
|
EvalContext() EvalContext
|
|
EnterPath(addrs.ModuleInstance) EvalContext
|
|
ExitPath(addrs.ModuleInstance)
|
|
Execute(EvalContext, GraphNodeExecutable) tfdiags.Diagnostics
|
|
}
|
|
|
|
// NullGraphWalker is a GraphWalker implementation that does nothing.
|
|
// This can be embedded within other GraphWalker implementations for easily
|
|
// implementing all the required functions.
|
|
type NullGraphWalker struct{}
|
|
|
|
func (NullGraphWalker) EvalContext() EvalContext { return new(MockEvalContext) }
|
|
func (NullGraphWalker) EnterPath(addrs.ModuleInstance) EvalContext { return new(MockEvalContext) }
|
|
func (NullGraphWalker) ExitPath(addrs.ModuleInstance) {}
|
|
func (NullGraphWalker) Execute(EvalContext, GraphNodeExecutable) tfdiags.Diagnostics { return nil }
|