MCPcopy Create free account
hub / github.com/coder/coder / Read

Method Read

aibridge/intercept/apidump/streaming.go:46–59  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

44}
45
46func (s *streamingBodyDumper) Read(p []byte) (int, error) {
47 n, err := s.body.Read(p)
48 if n > 0 {
49 s.init()
50 if s.initErr != nil && s.logger != nil {
51 s.logger(s.initErr)
52 }
53 if s.file != nil {
54 // Write raw bytes as they stream through.
55 _, _ = s.file.Write(p[:n])
56 }
57 }
58 return n, err
59}
60
61func (s *streamingBodyDumper) Close() error {
62 // Ensure init() has completed to avoid racing with Read().

Callers

nothing calls this directly

Calls 3

initMethod · 0.95
ReadMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected