MCPcopy Create free account
hub / github.com/Shopify/ghostferry / HandleScript

Method HandleScript

control_server.go:348–368  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

346}
347
348func (this *ControlServer) HandleScript(w http.ResponseWriter, r *http.Request) {
349 if this.Config.CustomScripts == nil {
350 http.NotFound(w, r)
351 return
352 }
353
354 name, err := scriptName(r)
355 if err != nil {
356 http.Error(w, err.Error(), http.StatusInternalServerError)
357 return
358 }
359
360 cmd, found := this.Config.CustomScripts[name]
361 if !found {
362 http.NotFound(w, r)
363 return
364 }
365
366 this.startScriptInBackground(name, cmd)
367 returnSuccess(w, r)
368}
369
370func (this *ControlServer) HandleConfigGet(w http.ResponseWriter, r *http.Request) {
371 w.Header().Set("Content-Type", "application/json")

Callers

nothing calls this directly

Calls 4

scriptNameFunction · 0.85
returnSuccessFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected