server

package
v1.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LayoutTemplateFiles = []string{
	"_layout/layout.html",
	"_layout/header.html",
	"_layout/footer.html",
}

Functions

func BuildPageHeader added in v1.1.1

func BuildPageHeader() (string, error)

func CompileTimeCheck added in v1.1.1

func CompileTimeCheck(fsys fs.FS) error

func FormatTimeDiff added in v1.1.1

func FormatTimeDiff(ts time.Time) template.HTML

func GetTemplate added in v1.1.1

func GetTemplate(files ...string) *template.Template

func GetTemplateFuncs added in v1.1.1

func GetTemplateFuncs() template.FuncMap

GetTemplateFuncs will get the template functions

func GetTemplateNames added in v1.1.1

func GetTemplateNames() []string

func HandleNotFound added in v1.1.1

func HandleNotFound(w http.ResponseWriter, r *http.Request)

func HandlePageError added in v1.1.1

func HandlePageError(w http.ResponseWriter, r *http.Request, pageError error)

func HandleTemplateError added in v1.1.1

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 added in v1.1.1

func IncludeHTML(path string) template.HTML

func UnmarshalAuditMetadata added in v1.1.9

func UnmarshalAuditMetadata(metadataStr string) map[string]interface{}

UnmarshalAuditMetadata parses audit metadata JSON string into a map

Types

type ErrorPageData added in v1.1.1

type ErrorPageData struct {
	CallTime   time.Time
	CallUrl    string
	ErrorMsg   string
	StackTrace string
	Version    string
}

type Frontend added in v1.1.1

type Frontend struct {
	NotFoundHandler func(http.ResponseWriter, *http.Request)
	// contains filtered or unexported fields
}

func NewFrontend added in v1.1.1

func NewFrontend(config *types.FrontendConfig, staticEmbedFS embed.FS, templateEmbedFS embed.FS) (*Frontend, error)

func (*Frontend) ServeHTTP added in v1.1.1

func (frontend *Frontend) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Meta added in v1.1.1

type Meta struct {
	Title       string
	Description string
	Domain      string
	Path        string
	Tlabel1     string
	Tdata1      string
	Tlabel2     string
	Tdata2      string
	Templates   string
}

type PageData added in v1.1.1

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
}

func InitPageData added in v1.1.1

func InitPageData(r *http.Request, active, path, title string, mainTemplates []string) *PageData

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL