MCPcopy Create free account
hub / github.com/zalando/skipper / writeParts

Function writeParts

proxy/proxy_test.go:286–298  ·  view source on GitHub ↗
(w io.Writer, parts int, data []byte)

Source from the content-addressed store, hash-verified

284func voidCheck(*http.Request) {}
285
286func writeParts(w io.Writer, parts int, data []byte) {
287 partSize := len(data) / parts
288 i := 0
289 for ; i+partSize <= len(data); i += partSize {
290 w.Write(data[i : i+partSize])
291 time.Sleep(streamingDelay)
292 if f, ok := w.(http.Flusher); ok {
293 f.Flush()
294 }
295 }
296
297 w.Write(data[i:])
298}
299
300func startTestServer(payload []byte, parts int, check requestCheck) *httptest.Server {
301 return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers 1

startTestServerFunction · 0.85

Calls 2

FlushMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…