Documentation
¶
Index ¶
- Variables
- func CollectChanges(resourceFieldPath string, linkFieldPath string, ...) error
- func CollectLinkDataChanges(linkFieldPath string, currentLinkData *core.MappingNode, ...) error
- func GetAnnotation(resourceChanges *provider.Changes, annotationName string, ...) *core.MappingNode
- func GetLinkDataFromState(state *state.LinkState) *core.MappingNode
- func GetResolvedResource(resourceChanges *provider.Changes) *provider.ResolvedResource
- func GetResourceNameFromChanges(changes *provider.Changes) string
- func IsFieldKnownOnDeploy(changes *provider.Changes, fieldPath string) bool
Constants ¶
This section is empty.
Variables ¶
var ( // ErrMissingResolvedResource is an error that is returned when a set of resource // changes does not contain a resolved resource. ErrMissingResolvedResource = errors.New("resource changes missing resolved resource") )
Functions ¶
func CollectChanges ¶
func CollectChanges( resourceFieldPath string, linkFieldPath string, currentLinkData *core.MappingNode, resourceChanges *provider.Changes, collectIn *provider.LinkChanges, ) error
CollectChanges deals with collecting changes into the given *provider.Changes struct reference for a given field in a resource. This only supports collecting changes for scalar fields in the resource spec. scalar fields meaning strings, booleans, integers and floating point numbers.
func CollectLinkDataChanges ¶
func CollectLinkDataChanges( linkFieldPath string, currentLinkData *core.MappingNode, collectIn *provider.LinkChanges, newValue *core.MappingNode, ) error
CollectLinkDataChanges deals with collecting changes into the given *provider.Changes struct reference for a given link data field. This should be used for any link data that is not derived directly from a resource spec field. For example, this should be used for values that are derived from configuration in resource annotations or static logic in the link implementation. This only supports collecting changes for scalar fields in the link data. Scalar fields meaning strings, booleans, integers and floating point numbers.
func GetAnnotation ¶
func GetAnnotation( resourceChanges *provider.Changes, annotationName string, defaultValue *core.MappingNode, ) *core.MappingNode
GetAnnotation returns the annotation with the given name from the resolved resource contained in the given set of resource changes. If the annotation is not found, the provided default value is returned.
func GetLinkDataFromState ¶
func GetLinkDataFromState(state *state.LinkState) *core.MappingNode
GetLinkDataFromState returns the link data from the given state, returning nil if the provided state is nil. This wraps the link data in a MappingNode with the "Fields" property populated with the link data.
func GetResolvedResource ¶
func GetResolvedResource(resourceChanges *provider.Changes) *provider.ResolvedResource
GetResolvedResource attempts to extract the resolved resource from the given set of resource changes. If the provided resource changes are nil, this function returns nil.
func GetResourceNameFromChanges ¶
GetResourceNameFromChanges returns the resource name from the given changes, returning an empty string if the provided changes are nil.
Types ¶
This section is empty.