reload

package
v0.0.0-...-9fb3cb1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2015 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TmplMap = make(map[string]TmplName)

	// NOTE: This MUST match reload/enum.go!
	Tmpls = Templates{
		[]*template.Template{

			template.Must(template.ParseFiles(filepath.Join(templatePath, "Index"+templateExt), base)),
			template.Must(template.ParseFiles(filepath.Join(templatePath, "About"+templateExt), base)),
			template.Must(template.ParseFiles(filepath.Join(templatePath, "Login"+templateExt), base)),
			template.Must(template.ParseFiles(filepath.Join(templatePath, "Create"+templateExt), base)),
			template.Must(template.ParseFiles(filepath.Join(templatePath, "Signup"+templateExt), base)),
			template.Must(template.ParseFiles(filepath.Join(templatePath, "ThankYou"+templateExt), base)),
			template.Must(template.ParseFiles(filepath.Join(templatePath, "ErrorPage"+templateExt), base)),
		},
		watcher,
		&sync.Mutex{},
	}
)

Functions

This section is empty.

Types

type Templates

type Templates struct {
	Templates []*template.Template

	*inotify.Watcher
	*sync.Mutex
}

Templates encapsulates our template files so we can load them into memory when the app is first run, but still be able to hot swap them.

func (*Templates) Watch

func (t *Templates) Watch()

type TmplName

type TmplName uint8 // template name enum

Max 255 templates. Could bump it up to uint16 if needed...

const (
	// SiteRouter
	Index TmplName = iota
	About
	Login
	Create
	Signup
	ThankYou
	ErrorPage
)

func (TmplName) String

func (i TmplName) String() string

Jump to

Keyboard shortcuts

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