Documentation
¶
Overview ¶
Package path provides a Terraform attribute type for Windows file paths that suppresses spurious plan-vs-apply diffs from cosmetic representation differences. See Path.StringSemanticEquals for the normalization it applies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Type = pathType{}
Type is the singleton attribute type for Windows file paths. Pass it as `CustomType:` on string attributes whose value is a path emitted by a Hyper-V cmdlet.
Functions ¶
This section is empty.
Types ¶
type Path ¶
type Path struct {
basetypes.StringValue
}
Path is the attribute-value implementation. Embeds StringValue so the .ValueString() / .IsNull() / .IsUnknown() accessors that resource code uses continue to work unchanged after a schema's CustomType is set to path.Type.
func NewPathNull ¶
func NewPathNull() Path
NewPathNull constructs a null Path. Convenient for collapsing empty optional-attribute reads to schema-null on the wire.
func NewPathUnknown ¶
func NewPathUnknown() Path
NewPathUnknown constructs an unknown Path. Used in plan modification when a value depends on apply-time information.
func NewPathValue ¶
NewPathValue constructs a known, non-null Path. Convenient when hydrating a model from a typed-client struct on Read.
func (Path) Equal ¶
Equal compares two Path values for raw equality (byte-for-byte). The framework calls this for known-after-apply tracking and other plan-machinery checks where we DO want strict equality. Semantic equality is the separate StringSemanticEquals method.
func (Path) StringSemanticEquals ¶
func (p Path) StringSemanticEquals(_ context.Context, newValuable basetypes.StringValuable) (bool, diag.Diagnostics)
StringSemanticEquals normalizes both sides (slashes folded to backslash, lowercased) before comparing, so a user-written C:/foo and Hyper-V's echoed C:\foo compare equal and the framework suppresses the diff. The framework only calls this when both sides are known and non-null; null/unknown handling happens before this method runs.