Documentation
¶
Index ¶
- func ExtractOrReadBinFS(dest string, siteFS fs.FS) (http.FileSystem, map[string]string, error)
- func FS() fs.FS
- func Handler(siteFS fs.FS, binFS http.FileSystem, binHashes map[string]string) http.Handler
- func RenderStaticErrorPage(rw http.ResponseWriter, r *http.Request, data ErrorPageData)
- func ShouldCacheFile(reqFile string) bool
- type ErrorPageData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractOrReadBinFS ¶ added in v0.7.4
ExtractOrReadBinFS checks the provided fs for compressed coder binaries and extracts them into dest/bin if found. As a fallback, the provided FS is checked for a /bin directory, if it is non-empty it is returned. Finally dest/bin is returned as a fallback allowing binaries to be manually placed in dest (usually ${CODER_CACHE_DIRECTORY}/site/bin).
Returns a http.FileSystem that serves unpacked binaries, and a map of binary name to SHA1 hash. The returned hash map may be incomplete or contain hashes for missing files.
func RenderStaticErrorPage ¶ added in v0.9.3
func RenderStaticErrorPage(rw http.ResponseWriter, r *http.Request, data ErrorPageData)
RenderStaticErrorPage renders the static error page. This is used by app requests to avoid dependence on the dashboard but maintain the ability to render a friendly error page on subdomains.