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

Function String

cft/parse/parse.go:60–68  ·  view source on GitHub ↗

String returns a cft.Template parsed from a string

(input string)

Source from the content-addressed store, hash-verified

58
59// String returns a cft.Template parsed from a string
60func String(input string) (*cft.Template, error) {
61 var n yaml.Node
62 err := yaml.Unmarshal([]byte(input), &n)
63 if err != nil {
64 return &cft.Template{}, fmt.Errorf("invalid YAML: %s", err)
65 }
66
67 return Node(&n)
68}
69
70// Node returns a cft.Template parse from a *yaml.Node
71func Node(n *yaml.Node) (*cft.Template, error) {

Callers 15

FileFunction · 0.92
TestReadStringFunction · 0.92
TestEmptySubFunction · 0.92
ExampleFunction · 0.92
TestGetResourceFunction · 0.92
TestGetResourcesOfTypeFunction · 0.92
TestPreserveCommentsFunction · 0.92
TestMainFunction · 0.92
checkMatchFunction · 0.92
TestFindInMapFunction · 0.92
TestZipLinesFunction · 0.92
TestMultiWithGTFunction · 0.92

Calls 1

NodeFunction · 0.70

Tested by 15

TestReadStringFunction · 0.74
TestEmptySubFunction · 0.74
ExampleFunction · 0.74
TestGetResourceFunction · 0.74
TestGetResourcesOfTypeFunction · 0.74
TestPreserveCommentsFunction · 0.74
TestMainFunction · 0.74
checkMatchFunction · 0.74
TestFindInMapFunction · 0.74
TestZipLinesFunction · 0.74
TestMultiWithGTFunction · 0.74
TestUnicodeJsonFunction · 0.74