Movatterモバイル変換


[0]ホーム

URL:


site

package
v2.23.0Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License:AGPL-3.0Imports:42Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcExtractOrReadBinFS

func ExtractOrReadBinFS(deststring, siteFSfs.FS) (http.FileSystem, map[string]string,error)

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.

funcFS

func FS()fs.FS

funcOnlyFilesadded inv2.9.0

func OnlyFiles(filesfs.FS)fs.FS

OnlyFiles returns a new fs.FS that only contains files. If a directory isrequested, os.ErrNotExist is returned. This prevents directory listings frombeing served.

funcRenderOAuthAllowPageadded 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

func ShouldCacheFile(reqFilestring)bool

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}

funcNew

func New(opts *Options) *Handler

func (*Handler)ServeHTTP

func (h *Handler) ServeHTTP(rwhttp.ResponseWriter, r *http.Request)

typeOptions

type Options struct {BinFShttp.FileSystemBinHashes         map[string]stringDatabasedatabase.StoreSiteFSfs.FSOAuth2Configs     *httpmw.OAuth2ConfigsDocsURLstringBuildInfocodersdk.BuildInfoResponseAppearanceFetcher *atomic.Pointer[appearance.Fetcher]Entitlements      *entitlements.SetTelemetrytelemetry.ReporterLoggerslog.Logger}

typeRenderOAuthAllowDataadded inv2.9.0

type RenderOAuthAllowData struct {AppIconstringAppNamestringCancelURIstringRedirectURIstringUsernamestring}

RenderOAuthAllowData contains the variables that are found insite/static/oauth2allow.html.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp