MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / InvokeHandler

Function InvokeHandler

pkg/controller/client/rpc_test.go:129–140  ·  view source on GitHub ↗
(withError bool)

Source from the content-addressed store, hash-verified

127}
128
129func InvokeHandler(withError bool) func(w http.ResponseWriter, r *http.Request) {
130 if withError {
131 return func(w http.ResponseWriter, r *http.Request) {
132 w.WriteHeader(http.StatusInternalServerError)
133 w.Write([]byte("oops"))
134 }
135 }
136 return func(w http.ResponseWriter, r *http.Request) {
137 w.WriteHeader(http.StatusOK)
138 w.Write([]byte("hello world"))
139 }
140}

Callers 1

Calls 2

WriteMethod · 0.65
WriteHeaderMethod · 0.45

Tested by

no test coverage detected