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

Method Read

asyncbuffer/buffer_test.go:54–60  ·  view source on GitHub ↗

Read reads data from the testReader, simulating a slow read and a potential failure

(p []byte)

Source from the content-addressed store, hash-verified

52
53// Read reads data from the testReader, simulating a slow read and a potential failure
54func (r *erraticReader) Read(p []byte) (n int, err error) {
55 cur := r.reader.BytesRead()
56 if r.failAt > 0 && r.failAt < cur+int64(len(p)) {
57 return 0, errors.New("simulated read failure")
58 }
59 return r.reader.Read(p)
60}
61
62// Close forwards closing to the underlying reader
63func (r *erraticReader) Close() error {

Callers 5

ReadMethod · 0.45
ReadMethod · 0.45
generateSourceDataFunction · 0.45
TestAsyncBufferReaderFunction · 0.45
TestAsyncBufferCloseFunction · 0.45

Calls 1

BytesReadMethod · 0.80

Tested by

no test coverage detected