ProvisionerJobParam returns the template from the ExtractTemplateParam handler.
(r *http.Request)
| 17 | |
| 18 | // ProvisionerJobParam returns the template from the ExtractTemplateParam handler. |
| 19 | func WorkspaceResourceParam(r *http.Request) database.WorkspaceResource { |
| 20 | resource, ok := r.Context().Value(workspaceResourceParamContextKey{}).(database.WorkspaceResource) |
| 21 | if !ok { |
| 22 | panic("developer error: workspace resource param middleware not provided") |
| 23 | } |
| 24 | return resource |
| 25 | } |
| 26 | |
| 27 | // ExtractWorkspaceResourceParam grabs a workspace resource from the "provisionerjob" URL parameter. |
| 28 | func ExtractWorkspaceResourceParam(db database.Store) func(http.Handler) http.Handler { |