(fh *FileHandle, offset uint64, size uint32)
| 318 | } |
| 319 | |
| 320 | func (b *S3ReadBuffer) initBuffer(fh *FileHandle, offset uint64, size uint32) { |
| 321 | getFunc := func() (io.ReadCloser, error) { |
| 322 | resp, err := b.s3.GetBlob(&GetBlobInput{ |
| 323 | Key: fh.key, |
| 324 | Start: offset, |
| 325 | Count: uint64(size), |
| 326 | }) |
| 327 | if err != nil { |
| 328 | return nil, err |
| 329 | } |
| 330 | |
| 331 | return resp.Body, nil |
| 332 | } |
| 333 | |
| 334 | if b.buf == nil { |
| 335 | b.buf = Buffer{}.Init(b.mbuf, getFunc) |
| 336 | } else { |
| 337 | b.buf.ReInit(getFunc) |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | func (b *S3ReadBuffer) Read(offset uint64, p []byte) (n int, err error) { |
| 342 | if b.offset == offset { |
no test coverage detected