wg-portal/internal/wireguard/template.go

21 lines
341 B
Go
Raw Normal View History

2020-11-06 06:21:47 -05:00
package wireguard
import (
"embed"
"html/template"
"strings"
)
//go:embed tpl/*
var Templates embed.FS
2020-11-09 14:26:34 -05:00
var templateCache *template.Template
func init() {
var err error
templateCache, err = template.New("server").Funcs(template.FuncMap{"StringsJoin": strings.Join}).ParseFS(Templates, "tpl/*.tpl")
if err != nil {
panic(err)
}
}