Documentation
¶
Index ¶
- Variables
- func BuildPageHeader() (string, error)
- func CompileTimeCheck(fsys fs.FS) error
- func FormatTimeDiff(ts time.Time) template.HTML
- func GetTemplate(files ...string) *template.Template
- func GetTemplateFuncs() template.FuncMap
- func GetTemplateNames() []string
- func HandleNotFound(w http.ResponseWriter, r *http.Request)
- func HandlePageError(w http.ResponseWriter, r *http.Request, pageError error)
- func HandleTemplateError(w http.ResponseWriter, r *http.Request, fileIdentifier string, ...) error
- func IncludeHTML(path string) template.HTML
- func JSONMarshal(v interface{}) template.JS
- type ErrorPageData
- type Frontend
- type Meta
- type PageData
Constants ¶
This section is empty.
Variables ¶
View Source
var LayoutTemplateFiles = []string{
"_layout/layout.html",
"_layout/header.html",
"_layout/footer.html",
}
Functions ¶
func BuildPageHeader ¶
func CompileTimeCheck ¶
func GetTemplate ¶
func GetTemplateFuncs ¶
GetTemplateFuncs will get the template functions
func GetTemplateNames ¶
func GetTemplateNames() []string
func HandleNotFound ¶
func HandleNotFound(w http.ResponseWriter, r *http.Request)
func HandlePageError ¶
func HandlePageError(w http.ResponseWriter, r *http.Request, pageError error)
func HandleTemplateError ¶
func HandleTemplateError(w http.ResponseWriter, r *http.Request, fileIdentifier string, functionIdentifier string, infoIdentifier string, err error) error
used to handle errors constructed by Template.ExecuteTemplate correctly
func IncludeHTML ¶
func JSONMarshal ¶
JSONMarshal converts a Go value to JSON for use in templates
Types ¶
type ErrorPageData ¶
type Frontend ¶
type Frontend struct {
NotFoundHandler func(http.ResponseWriter, *http.Request)
// contains filtered or unexported fields
}
func NewFrontend ¶
func NewFrontend(config *types.FrontendConfig, logger logrus.FieldLogger, staticEmbedFS embed.FS, templateEmbedFS embed.FS) (*Frontend, error)
type PageData ¶
type PageData struct {
Active string
Meta *Meta
Data interface{}
Version string
BuildTime string
Year int
Title string
Lang string
Debug bool
DebugTemplates []string
DisableTxMetrics bool
DisableAuditLogs bool
HasEL bool // Whether EL bootnode is active
HasCL bool // Whether CL bootnode is active
}
func InitPageData ¶
func (*PageData) SetBootnodeStatus ¶ added in v0.0.2
SetBootnodeStatus sets the HasEL and HasCL flags based on bootnode table availability. This should be called by handlers that have access to the bootnode service.
Click to show internal directories.
Click to hide internal directories.