MCPcopy Index your code
hub / github.com/cortexproject/cortex / validateTemplateFiles

Function validateTemplateFiles

pkg/configs/api/api.go:255–263  ·  view source on GitHub ↗
(c userconfig.Config)

Source from the content-addressed store, hash-verified

253}
254
255func validateTemplateFiles(c userconfig.Config) error {
256 for fn, content := range c.TemplateFiles {
257 if _, err := template.New(fn).Funcs(template.FuncMap(amtemplate.DefaultFuncs)).Parse(content); err != nil {
258 return err
259 }
260 }
261
262 return nil
263}
264
265// ConfigsView renders multiple configurations, mapping userID to userconfig.View.
266// Exposed only for tests.

Callers 2

setConfigMethod · 0.85

Calls 1

ParseMethod · 0.80

Tested by 1