site
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- func ExtractOrReadBinFS(dest string, siteFS fs.FS) (http.FileSystem, map[string]string, error)
- func FS() fs.FS
- func OnlyFiles(files fs.FS) fs.FS
- func RenderOAuthAllowPage(rw http.ResponseWriter, r *http.Request, data RenderOAuthAllowData)
- func RenderStaticErrorPage(rw http.ResponseWriter, r *http.Request, data ErrorPageData)
- func ShouldCacheFile(reqFile string) bool
- type ErrorPageData
- type Handler
- type Options
- type RenderOAuthAllowData
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcExtractOrReadBinFS¶
ExtractOrReadBinFS checks the provided fs for compressed coder binaries andextracts them into dest/bin if found. As a fallback, the provided FS ischecked for a /bin directory, if it is non-empty it is returned. Finallydest/bin is returned as a fallback allowing binaries to be manually placed indest (usually ${CODER_CACHE_DIRECTORY}/site/bin).
Returns a http.FileSystem that serves unpacked binaries, and a map of binaryname to SHA1 hash. The returned hash map may be incomplete or contain hashesfor missing files.
funcOnlyFiles¶added inv2.9.0
OnlyFiles returns a new fs.FS that only contains files. If a directory isrequested, os.ErrNotExist is returned. This prevents directory listings frombeing served.
funcRenderOAuthAllowPage¶added inv2.9.0
func RenderOAuthAllowPage(rwhttp.ResponseWriter, r *http.Request, dataRenderOAuthAllowData)
RenderOAuthAllowPage renders the static page for a user to "Allow" an createa new oauth2 link with an external site. This is when Coder is acting as theidentity provider.
This has to be done statically because Golang has to handle the full request.It cannot defer to the FE typescript easily.
funcRenderStaticErrorPage¶
func RenderStaticErrorPage(rwhttp.ResponseWriter, r *http.Request, dataErrorPageData)
RenderStaticErrorPage renders the static error page. This is used by apprequests to avoid dependence on the dashboard but maintain the ability torender a friendly error page on subdomains.
funcShouldCacheFile¶
Types¶
typeErrorPageData¶
type ErrorPageData struct {Statusint// HideStatus will remove the status code from the page.HideStatusboolTitlestringDescriptionstringRetryEnabledboolDashboardURLstringWarnings []stringAdditionalInfostringAdditionalButtonLinkstringAdditionalButtonTextstringRenderDescriptionMarkdownbool}
ErrorPageData contains the variables that are found insite/static/error.html.
typeHandler¶
type Handler struct {// 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(ctxcontext.Context) (any,error)Entitlements *entitlements.SetExperimentsatomic.Pointer[codersdk.Experiments]// contains filtered or unexported fields}
typeOptions¶
type Options struct {BinFShttp.FileSystemBinHashes map[string]stringDatabasedatabase.StoreSiteFSfs.FSOAuth2Configs *httpmw.OAuth2ConfigsDocsURLstringBuildInfocodersdk.BuildInfoResponseAppearanceFetcher *atomic.Pointer[appearance.Fetcher]Entitlements *entitlements.SetTelemetrytelemetry.ReporterLoggerslog.Logger}