MCPcopy
hub / github.com/SurgeDM/Surge / UpdateURL

Method UpdateURL

internal/core/remote_service.go:217–227  ·  view source on GitHub ↗

UpdateURL updates the URL of a paused or errored download via the remote API.

(id string, newURL string)

Source from the content-addressed store, hash-verified

215
216// UpdateURL updates the URL of a paused or errored download via the remote API.
217func (s *RemoteDownloadService) UpdateURL(id string, newURL string) error {
218 req := map[string]string{
219 "url": newURL,
220 }
221 resp, err := s.doRequest("PUT", "/update-url?id="+url.QueryEscape(id), req)
222 if err != nil {
223 return err
224 }
225 defer func() { _, _ = io.Copy(io.Discard, resp.Body); _ = resp.Body.Close() }()
226 return nil
227}
228
229// Delete cancels and removes a download.
230func (s *RemoteDownloadService) Delete(id string) error {

Callers

nothing calls this directly

Calls 2

doRequestMethod · 0.95
CloseMethod · 0.45

Tested by

no test coverage detected