Documentation ¶
Index ¶
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.
func ShouldCacheFile ¶ added in v0.6.1
Types ¶
type ErrorPageData ¶ added in v0.9.3
type ErrorPageData struct { Status int // HideStatus will remove the status code from the page. HideStatus bool Title string Description string RetryEnabled bool DashboardURL string }
ErrorPageData contains the variables that are found in site/static/error.html.
type Handler ¶ added in v0.6.1
type Handler struct { AppearanceFetcher func(ctx context.Context) (codersdk.AppearanceConfig, error) // RegionsFetcher will attempt to fetch the more detailed WorkspaceProxy data, but will fall back to the // regions if the user does not have the correct permissions. RegionsFetcher func(ctx context.Context) (any, error) Entitlements atomic.Pointer[codersdk.Entitlements] Experiments atomic.Pointer[codersdk.Experiments] // contains filtered or unexported fields }