MCPcopy Create free account
hub / github.com/LumePart/Explo / ParseResp

Function ParseResp

src/util/http.go:72–79  ·  view source on GitHub ↗
(body []byte, target *T)

Source from the content-addressed store, hash-verified

70}
71
72func ParseResp[T any](body []byte, target *T) error {
73
74 if err := json.Unmarshal(body, target); err != nil {
75 slog.Debug("response info", logging.RuntimeAttr(string(body)))
76 return fmt.Errorf("error unmarshaling response body: %s", err.Error())
77 }
78 return nil
79}
80
81// DownloadFile downloads a URL to destPath, creating parent directories as needed.
82// No-op if destPath already exists. Returns the resolved local path on success.

Callers 15

SearchSongsMethod · 0.92
CreatePlaylistMethod · 0.92
SearchPlaylistMethod · 0.92
subsonicRequestMethod · 0.92
GetLibraryMethod · 0.92
SearchSongsMethod · 0.92
SearchPlaylistMethod · 0.92
CreatePlaylistMethod · 0.92
ResolveUserIDMethod · 0.92
GetLibraryMethod · 0.92
SearchSongsMethod · 0.92
SearchPlaylistMethod · 0.92

Calls 1

RuntimeAttrFunction · 0.92

Tested by

no test coverage detected