MCPcopy
hub / github.com/harness/harness / DeletePackage

Method DeletePackage

registry/app/api/handler/npm/delete_package.go:26–40  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

24)
25
26func (h *handler) DeletePackage(w http.ResponseWriter, r *http.Request) {
27 contextInfo := request.ArtifactInfoFrom(r.Context())
28 info, ok := contextInfo.(npm.ArtifactInfo)
29 if !ok {
30 h.HandleErrors2(r.Context(), errcode.ErrCodeInvalidRequest.WithMessage("failed to fetch info from context"), w)
31 return
32 }
33
34 response := h.controller.DeletePackage(r.Context(), info)
35 if !commons.IsEmpty(response.GetError()) {
36 http.Error(w, response.GetError().Error(), http.StatusInternalServerError)
37 return
38 }
39 w.WriteHeader(http.StatusNoContent)
40}

Callers

nothing calls this directly

Calls 8

HandleErrors2Method · 0.95
ArtifactInfoFromFunction · 0.92
IsEmptyFunction · 0.92
DeletePackageMethod · 0.65
GetErrorMethod · 0.65
ErrorMethod · 0.65
WithMessageMethod · 0.45
WriteHeaderMethod · 0.45

Tested by

no test coverage detected