templatewatcher

package
v0.0.0-...-5e41430 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package templatewatcher provides ways to automatically reparse templates files whenever a change is detected

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TemplateWatcher

type TemplateWatcher struct {
	// contains filtered or unexported fields
}

TemplateWatcher is used to automatically reparse teplate files whenever a change is detected

func NewTemplateWatcher

func NewTemplateWatcher(name string, folders []string) *TemplateWatcher

NewTemplateWatcher creates a new TemplateWatcher watching all the files which name ends with ".html" inside the provided folders. Subfolders are not going to be watched

func (*TemplateWatcher) GetTemplate

func (tw *TemplateWatcher) GetTemplate() *template.Template

GetTemplate returns a reference to the watched template

func (*TemplateWatcher) Reload

func (tw *TemplateWatcher) Reload()

Reload reloads all template files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL