MCPcopy Create free account
hub / github.com/aws-cloudformation/rain / transform

Function transform

cft/pkg/pkg.go:86–105  ·  view source on GitHub ↗
(ctx *transformContext)

Source from the content-addressed store, hash-verified

84}
85
86func transform(ctx *transformContext) (bool, error) {
87 changed := false
88
89 // registry is a map of functions defined in rain.go
90 for path, fn := range registry {
91 for found := range s11n.MatchAll(ctx.nodeToTransform, path) {
92 nodeParent := node.GetParent(found, ctx.nodeToTransform, nil)
93 nodeParent.Parent = ctx.parent
94 c, err := fn(&directiveContext{found, ctx.rootDir, ctx.t, nodeParent, ctx.fs, ctx.baseUri})
95 if err != nil {
96 config.Debugf("Error packaging template: %s\n", err)
97 return false, err
98 }
99
100 changed = changed || c
101 }
102 }
103
104 return changed, nil
105}
106
107// processRainSection returns true if the Rain section of the template existed
108// The section is removed by this function

Callers 3

moduleFunction · 0.85
TemplateFunction · 0.85
includeLiteralFunction · 0.85

Calls 3

MatchAllFunction · 0.92
GetParentFunction · 0.92
DebugfFunction · 0.92

Tested by

no test coverage detected