MCPcopy Index your code
hub / github.com/syncthing/syncthing / getDebugFile

Method getDebugFile

lib/api/api.go:961–975  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

959}
960
961func (s *service) getDebugFile(w http.ResponseWriter, r *http.Request) {
962 qs := r.URL.Query()
963 folder := qs.Get("folder")
964 file := qs.Get("file")
965
966 lf, _, _ := s.model.CurrentFolderFile(folder, file)
967 gf, _, _ := s.model.CurrentGlobalFile(folder, file)
968 av, _ := s.model.Availability(folder, protocol.FileInfo{Name: file}, protocol.BlockInfo{})
969
970 sendJSON(w, map[string]interface{}{
971 "global": jsonFileInfo(gf),
972 "local": jsonFileInfo(lf),
973 "availability": av,
974 })
975}
976
977func (s *service) postSystemRestart(w http.ResponseWriter, _ *http.Request) {
978 s.flushResponse(`{"ok": "restarting"}`, w)

Callers

nothing calls this directly

Calls 6

sendJSONFunction · 0.85
jsonFileInfoTypeAlias · 0.85
GetMethod · 0.65
CurrentFolderFileMethod · 0.65
CurrentGlobalFileMethod · 0.65
AvailabilityMethod · 0.65

Tested by

no test coverage detected