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

Function OrganizationParam

coderd/httpmw/organizationparam.go:26–32  ·  view source on GitHub ↗

OrganizationParam returns the organization from the ExtractOrganizationParam handler.

(r *http.Request)

Source from the content-addressed store, hash-verified

24
25// OrganizationParam returns the organization from the ExtractOrganizationParam handler.
26func OrganizationParam(r *http.Request) database.Organization {
27 organization, ok := r.Context().Value(organizationParamContextKey{}).(database.Organization)
28 if !ok {
29 panic("developer error: organization param middleware not provided")
30 }
31 return organization
32}
33
34// OrganizationMemberParam returns the organization membership that allowed the query
35// from the ExtractOrganizationParam handler.

Calls 2

ContextMethod · 0.65
ValueMethod · 0.45

Tested by 1

TestOrganizationParamFunction · 0.74