Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTemplateNotFound = errors.New("template was not found")
)
Functions ¶
This section is empty.
Types ¶
type HTMLTemplate ¶
type HTMLTemplate struct {
// contains filtered or unexported fields
}
HTMLTemplate caches html templates
func New ¶
func New(dir string, hotReload bool) (*HTMLTemplate, error)
New Creates a new HTMLTemplate cache
func (*HTMLTemplate) Render ¶
func (htmlTs *HTMLTemplate) Render(w http.ResponseWriter, r *http.Request, templateName string, data any) error
Render renders HTML template and puts rendered HTML into response
func (*HTMLTemplate) RenderComponent ¶
func (htmlTs *HTMLTemplate) RenderComponent(w http.ResponseWriter, r *http.Request, templateName string, data any) error
RenderComponent renders a partial HTML component
Click to show internal directories.
Click to hide internal directories.