mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 00:12:11 +08:00
add email verification
This commit is contained in:
@@ -9,16 +9,16 @@ import (
|
||||
const templateBasePath = "templates"
|
||||
const templateFileExtension = "tmpl"
|
||||
|
||||
var templateCache = make(map[string]*CachedTemplate)
|
||||
var templateCache = make(map[KnownTemplate]*CachedTemplate)
|
||||
|
||||
// CachedTemplate represents a cached template
|
||||
type CachedTemplate struct {
|
||||
templateName string
|
||||
templateName KnownTemplate
|
||||
templateContent *template.Template
|
||||
}
|
||||
|
||||
// GetTemplate returns a cached template instance according to the template name
|
||||
func GetTemplate(templateName string) (*template.Template, error) {
|
||||
func GetTemplate(templateName KnownTemplate) (*template.Template, error) {
|
||||
fullPath := filepath.Join(templateBasePath, fmt.Sprintf("%s.%s", templateName, templateFileExtension))
|
||||
|
||||
cachedTemplate, exists := templateCache[templateName]
|
||||
|
||||
Reference in New Issue
Block a user