summaryrefslogtreecommitdiffstats
path: root/tpl/template.go
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/template.go')
-rw-r--r--tpl/template.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/tpl/template.go b/tpl/template.go
index e04d2cc6c..2cef92bb2 100644
--- a/tpl/template.go
+++ b/tpl/template.go
@@ -38,13 +38,15 @@ type TemplateHandler interface {
LoadTemplates(prefix string)
PrintErrors()
+ NewTextTemplate() TemplateParseFinder
+
MarkReady()
RebuildClone()
}
// TemplateFinder finds templates.
type TemplateFinder interface {
- Lookup(name string) *TemplateAdapter
+ Lookup(name string) (Template, bool)
}
// Template is the common interface between text/template and html/template.
@@ -53,6 +55,17 @@ type Template interface {
Name() string
}
+// TemplateParser is used to parse ad-hoc templates, e.g. in the Resource chain.
+type TemplateParser interface {
+ Parse(name, tpl string) (Template, error)
+}
+
+// TemplateParseFinder provides both parsing and finding.
+type TemplateParseFinder interface {
+ TemplateParser
+ TemplateFinder
+}
+
// TemplateExecutor adds some extras to Template.
type TemplateExecutor interface {
Template