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

Method regions

enterprise/coderd/workspaceproxy.go:53–61  ·  view source on GitHub ↗

NOTE: this doesn't need a swagger definition since AGPL already has one, and this route overrides the AGPL one.

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

Source from the content-addressed store, hash-verified

51// NOTE: this doesn't need a swagger definition since AGPL already has one, and
52// this route overrides the AGPL one.
53func (api *API) regions(rw http.ResponseWriter, r *http.Request) {
54 regions, err := api.fetchRegions(r.Context())
55 if err != nil {
56 httpapi.InternalServerError(rw, err)
57 return
58 }
59
60 httpapi.Write(r.Context(), rw, http.StatusOK, regions)
61}
62
63func (api *API) fetchRegions(ctx context.Context) (codersdk.RegionsResponse[codersdk.Region], error) {
64 //nolint:gocritic // this intentionally requests resources that users

Callers

nothing calls this directly

Calls 4

fetchRegionsMethod · 0.95
InternalServerErrorFunction · 0.92
WriteFunction · 0.92
ContextMethod · 0.65

Tested by

no test coverage detected