get the next chunk
(ctx context.Context)
| 1063 | |
| 1064 | // get the next chunk |
| 1065 | func (oo *openObject) getChunk(ctx context.Context) (err error) { |
| 1066 | if oo.id >= oo.d.Chunks() { |
| 1067 | return io.EOF |
| 1068 | } |
| 1069 | var chunk []byte |
| 1070 | err = oo.o.fs.pacer.Call(func() (bool, error) { |
| 1071 | chunk, err = oo.d.DownloadChunk(oo.id) |
| 1072 | return shouldRetry(ctx, err) |
| 1073 | }) |
| 1074 | if err != nil { |
| 1075 | return err |
| 1076 | } |
| 1077 | oo.id++ |
| 1078 | oo.chunk = chunk |
| 1079 | return nil |
| 1080 | } |
| 1081 | |
| 1082 | // Read reads up to len(p) bytes into p. |
| 1083 | func (oo *openObject) Read(p []byte) (n int, err error) { |
no test coverage detected