package checker import "html/template" var templateFuncs = template.FuncMap{ "string": func(s reportStatus) string { return string(s) }, "badgeClass": func(s reportStatus) string { switch s { case statusOK: return "badge-ok" case statusWarn: return "badge-warn" case statusFail: return "badge-fail" case statusInfo: return "badge-info" } return "badge-skip" }, "chkClass": func(s reportStatus) string { switch s { case statusOK: return "chk-ok" case statusWarn: return "chk-warn" case statusFail: return "chk-fail" case statusInfo: return "chk-info" } return "chk-skip" }, "chkIcon": func(s reportStatus) string { switch s { case statusOK: return "✓" case statusWarn: return "!" case statusFail: return "✗" case statusInfo: return "i" } return "·" }, } var autoconfigHTMLTemplate = template.Must(template.New("autoconfig").Funcs(templateFuncs).Parse(`
{{.Domain}}{{.HeadlineText}}
{{if .MX}}MX: {{range $i, $m := .MX}}{{if $i}}, {{end}}{{$m}}{{end}}
{{.URL}}
{{.VerdictText}}
{{.FinalURL}}| Type | Hostname | Port | Socket | Auth |
|---|---|---|---|---|
| {{.Type}} | {{.Hostname}} |
{{.Port}} | {{if .Encrypted}}{{.SocketType}}{{else}}{{.SocketType}}{{end}} | {{if .AuthSafe}}{{.Authentication}}{{else}}{{.Authentication}}{{end}} |
| Type | Hostname | Port | Socket | Auth |
|---|---|---|---|---|
| {{.Type}} | {{.Hostname}} |
{{.Port}} | {{if .Encrypted}}{{.SocketType}}{{else}}{{.SocketType}}{{end}} | {{if .AuthSafe}}{{.Authentication}}{{else}}{{.Authentication}}{{end}} |
{{.ServerURL}}{{.ServerURL}}| Service | Target | Port | Prio | Weight |
|---|---|---|---|---|
{{.Service}} |
{{if .Skip}}disabled (.){{else}}{{.Target}}{{end}} |
{{.Port}} | {{.Priority}} | {{.Weight}} |
No SRV records found.
{{end}}{{.URL}}
{{.VerdictText}}
Autodiscover probes were disabled.
{{end}}config-v1.1.xmlPaste-ready starting point. Adjust hostnames and ports before publishing.
{{.ExampleXML}}