mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 19:08:20 +00:00
24 lines
432 B
Go
24 lines
432 B
Go
package nftables
|
|
|
|
import (
|
|
"embed"
|
|
"text/template"
|
|
)
|
|
|
|
//go:embed template
|
|
var templateFS embed.FS
|
|
var templates *template.Template
|
|
|
|
func init() {
|
|
|
|
funcMap := template.FuncMap{
|
|
// The name "title" is what the function will be called in the template text.
|
|
"matcher": GenerateMatcher,
|
|
}
|
|
|
|
var err error
|
|
templates, err = template.New("").Funcs(funcMap).ParseFS(templateFS, "template/*.tmpl")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|