MCPcopy Create free account
hub / github.com/cloudwan/gohan / applyTemplateForAll

Function applyTemplateForAll

cli/template.go:224–235  ·  view source on GitHub ↗
(schemas []*SchemaWithPolicy, tpl *pongo2.Template, title, version, description, outputPath string)

Source from the content-addressed store, hash-verified

222}
223
224func applyTemplateForAll(schemas []*SchemaWithPolicy, tpl *pongo2.Template, title, version, description, outputPath string) {
225 output, err := tpl.Execute(pongo2.Context{"schemas": schemas, "title": title, "version": version, "description": description})
226 if err != nil {
227 util.ExitFatal(err)
228 return
229 }
230 if outputPath == "" {
231 fmt.Println(output)
232 } else {
233 ioutil.WriteFile(outputPath, []byte(output), 0644)
234 }
235}
236
237func applyTemplateForEachResourceGroup(schemas []*SchemaWithPolicy, tpl *pongo2.Template, version, description, outputPath string) {
238 for _, resourceGroup := range getAllResourceGroupsFromSchemas(schemas) {

Callers 1

doTemplateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected