Documentation ¶
Overview ¶
Package ui provides the assets via a virtual filesystem.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Assets = func() http.FileSystem { wd, err := os.Getwd() if err != nil { panic(err) } var assetsPrefix string switch filepath.Base(wd) { case "prometheus": assetsPrefix = "./web/ui" case "web": assetsPrefix = "./ui" case "ui": assetsPrefix = "./" } static := filter.Keep( http.Dir(path.Join(assetsPrefix, "static")), func(path string, fi os.FileInfo) bool { return fi.IsDir() || (!strings.HasSuffix(path, "map.js") && !strings.HasSuffix(path, "/bootstrap.js") && !strings.HasSuffix(path, "/bootstrap-theme.css") && !strings.HasSuffix(path, "/bootstrap.css")) }, ) templates := filter.Keep( http.Dir(path.Join(assetsPrefix, "templates")), func(path string, fi os.FileInfo) bool { return fi.IsDir() || strings.HasSuffix(path, ".html") }, ) return union.New(map[string]http.FileSystem{ "/templates": templates, "/static": static, }) }()
Assets contains the project's assets.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.