MCPcopy Index your code
hub / github.com/coder/coder / appearance

Method appearance

enterprise/coderd/appearance.go:30–42  ·  view source on GitHub ↗

@Summary Get appearance @ID get-appearance @Security CoderSessionToken @Produce json @Tags Enterprise @Success 200 {object} codersdk.AppearanceConfig @Router /api/v2/appearance [get]

(rw http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

28// @Success 200 {object} codersdk.AppearanceConfig
29// @Router /api/v2/appearance [get]
30func (api *API) appearance(rw http.ResponseWriter, r *http.Request) {
31 af := *api.AGPL.AppearanceFetcher.Load()
32 cfg, err := af.Fetch(r.Context())
33 if err != nil {
34 httpapi.Write(r.Context(), rw, http.StatusInternalServerError, codersdk.Response{
35 Message: "Failed to fetch appearance config.",
36 Detail: err.Error(),
37 })
38 return
39 }
40
41 httpapi.Write(r.Context(), rw, http.StatusOK, cfg)
42}
43
44type appearanceFetcher struct {
45 database database.Store

Callers

nothing calls this directly

Calls 5

WriteFunction · 0.92
FetchMethod · 0.65
ContextMethod · 0.65
LoadMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected