MCPcopy
hub / github.com/cloudflare/cloudflared / parseResponseBody

Function parseResponseBody

cfapi/base_client.go:137–144  ·  view source on GitHub ↗
(result *response, data interface{})

Source from the content-addressed store, hash-verified

135}
136
137func parseResponseBody(result *response, data interface{}) error {
138 // At this point we know the API call succeeded, so, parse out the inner
139 // result into the datatype provided as a parameter.
140 if err := json.Unmarshal(result.Result, &data); err != nil {
141 return errors.Wrap(err, "the Cloudflare API response was an unexpected type")
142 }
143 return nil
144}
145
146func fetchExhaustively[T any](requestFn func(int) (*http.Response, error)) ([]*T, error) {
147 page := 0

Callers 2

parseResponseFunction · 0.85
fetchPageFunction · 0.85

Calls 1

UnmarshalMethod · 0.45

Tested by

no test coverage detected