2020-11-06 12:21:47 +01:00
|
|
|
package wireguard
|
|
|
|
|
2021-04-03 22:38:22 +02:00
|
|
|
import (
|
|
|
|
"embed"
|
|
|
|
"strings"
|
2021-04-03 23:54:35 +02:00
|
|
|
"text/template"
|
2021-04-03 22:38:22 +02:00
|
|
|
)
|
2020-11-16 22:39:41 +01:00
|
|
|
|
2021-04-03 22:38:22 +02:00
|
|
|
//go:embed tpl/*
|
|
|
|
var Templates embed.FS
|
2020-11-09 20:26:34 +01:00
|
|
|
|
2021-04-03 22:38:22 +02: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)
|
|
|
|
}
|
|
|
|
}
|