Documentation
¶
Overview ¶
Package putil contains utility functions for working with [resource.PropertyValue]s and related types.
Index ¶
- func DeepEquals(a, b resource.PropertyValue) bool
- func FormatProviderReference(urn resource.URN, id resource.ID) string
- func FromUrns(urns []urn.URN) []string
- func GetPropertyDependencies(v property.Value) []urn.URN
- func IsComputed(v resource.PropertyValue) bool
- func IsSecret(v resource.PropertyValue) bool
- func MakeComputed(v resource.PropertyValue) resource.PropertyValue
- func MakeKnown(v resource.PropertyValue) resource.PropertyValue
- func MakePublic(v resource.PropertyValue) resource.PropertyValue
- func MakeSecret(v resource.PropertyValue) resource.PropertyValue
- func MergePropertyDependencies(m property.Map, dependencies map[string][]urn.URN) property.Map
- func ParseProviderReference(s string) (resource.URN, resource.ID, error)
- func ToUrns(s []string) []urn.URN
- func Walk(v property.Value, f func(property.Value) (continueWalking bool)) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepEquals ¶
func DeepEquals(a, b resource.PropertyValue) bool
DeepEquals checks if a and b are equal.
DeepEquals is different from a.DeepEquals(b) in two ways:
1. If does secret/computed/output folding, so secret(computed(v)) == computed(secret(v)).
2. It doesn't panic when computed values are present.
func FormatProviderReference ¶
FormatProviderReference formats the URN and ID into a string representation of a provider reference.
func GetPropertyDependencies ¶
GetPropertyDependencies gathers (deeply) the dependencies of the given property value.
func IsComputed ¶
func IsComputed(v resource.PropertyValue) bool
IsComputed checks if v is some form of a computed/unknown value.
func IsSecret ¶
func IsSecret(v resource.PropertyValue) bool
IsSecret checks if v should be treated as secret.
func MakeComputed ¶
func MakeComputed(v resource.PropertyValue) resource.PropertyValue
MakeComputed wraps v in a computed value if it is not already computed.
func MakeKnown ¶
func MakeKnown(v resource.PropertyValue) resource.PropertyValue
func MakePublic ¶
func MakePublic(v resource.PropertyValue) resource.PropertyValue
func MakeSecret ¶
func MakeSecret(v resource.PropertyValue) resource.PropertyValue
func MergePropertyDependencies ¶
MergePropertyDependencies merges the given dependencies into the property map.
Apply the dependencies to the property map, only for "legacy" values that don't have output dependencies. The caller may fold the output dependencies of a value's children into the dependencies map, and we seek to avoid treating those as true dependencies of the top-level value.
func ParseProviderReference ¶
ParseProviderReference parses the URN and ID from the string representation of a provider reference. If parsing was not possible, this function returns an error.
Types ¶
This section is empty.