MCPcopy Create free account
hub / github.com/cloudfoundry/brokerapi / respond

Method respond

handlers/api_handler.go:37–50  ·  view source on GitHub ↗
(w http.ResponseWriter, status int, requestIdentity string, response any)

Source from the content-addressed store, hash-verified

35}
36
37func (h APIHandler) respond(w http.ResponseWriter, status int, requestIdentity string, response any) {
38 w.Header().Set("Content-Type", "application/json")
39 if requestIdentity != "" {
40 w.Header().Set("X-Broker-API-Request-Identity", requestIdentity)
41 }
42 w.WriteHeader(status)
43
44 encoder := json.NewEncoder(w)
45 encoder.SetEscapeHTML(false)
46 err := encoder.Encode(response)
47 if err != nil {
48 h.logger.Error("encoding response", err, slog.Int("status", status), slog.Any("response", response))
49 }
50}
51
52type brokerVersion struct {
53 Major int

Callers 10

LastBindingOperationMethod · 0.95
GetInstanceMethod · 0.95
UpdateMethod · 0.95
CatalogMethod · 0.95
BindMethod · 0.95
DeprovisionMethod · 0.95
ProvisionMethod · 0.95
UnbindMethod · 0.95
LastOperationMethod · 0.95
GetBindingMethod · 0.95

Calls 3

HeaderMethod · 0.80
WriteHeaderMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected