MCPcopy Index your code
hub / github.com/imroc/req / Write

Method Write

middleware.go:365–378  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

363}
364
365func (w *callbackWriter) Write(p []byte) (n int, err error) {
366 n, err = w.Writer.Write(p)
367 if n <= 0 {
368 return
369 }
370 w.written += int64(n)
371 if w.written == w.totalSize {
372 w.callback(w.written)
373 } else if now := time.Now(); now.Sub(w.lastTime) >= w.interval {
374 w.lastTime = now
375 w.callback(w.written)
376 }
377 return
378}
379
380type callbackReader struct {
381 io.ReadCloser

Callers

nothing calls this directly

Calls 1

WriteMethod · 0.65

Tested by

no test coverage detected