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

Method closedError

asyncbuffer/buffer.go:428–440  ·  view source on GitHub ↗

closedError returns an error if the attempt to read on a closed reader was made. If the reader had an error, it returns that error instead.

()

Source from the content-addressed store, hash-verified

426// closedError returns an error if the attempt to read on a closed reader was made.
427// If the reader had an error, it returns that error instead.
428func (ab *AsyncBuffer) closedError() error {
429 // If the reader is closed, we return the error or nil
430 if !ab.closed.Load() {
431 return nil
432 }
433
434 err := ab.Error()
435 if err == nil {
436 err = errors.New("asyncbuffer.AsyncBuffer.ReadAt: attempt to read on closed reader")
437 }
438
439 return err
440}
441
442// offsetAvailable checks if the data at the given offset is available for reading.
443// It may return io.EOF if the reader is finished reading and the offset is beyond the end of the stream.

Callers 3

WaitMethod · 0.95
ReadAtMethod · 0.95
offsetAvailableMethod · 0.95

Calls 2

ErrorMethod · 0.95
LoadMethod · 0.80

Tested by

no test coverage detected