-
Notifications
You must be signed in to change notification settings - Fork 42
/
renderer.go
23 lines (20 loc) · 921 Bytes
/
renderer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package multitemplate
import (
"html/template"
"io/fs"
"github.com/gin-gonic/gin/render"
)
// Renderer type is the Agnostic Renderer for multitemplates.
// When gin is in debug mode then all multitemplates works with
// hot reloading allowing you modify file templates and seeing changes instantly.
// Renderer should be created using multitemplate.NewRenderer() constructor.
type Renderer interface {
render.HTMLRender
Add(name string, tmpl *template.Template)
AddFromFiles(name string, files ...string) *template.Template
AddFromGlob(name, glob string) *template.Template
AddFromFS(name string, fsys fs.FS, files ...string) *template.Template
AddFromString(name, templateString string) *template.Template
AddFromStringsFuncs(name string, funcMap template.FuncMap, templateStrings ...string) *template.Template
AddFromFilesFuncs(name string, funcMap template.FuncMap, files ...string) *template.Template
}