fs: add context.Ctx to ChunkWriter methods

WriteChunk in particular needs a different context from that which
OpenChunkWriter was used with so add it to all the methods.
This commit is contained in:
Nick Craig-Wood
2023-08-19 17:30:55 +01:00
parent f3bd02f0ef
commit 0d0bcdac31
4 changed files with 20 additions and 22 deletions

View File

@@ -652,13 +652,13 @@ type OpenChunkWriterFn func(ctx context.Context, remote string, src ObjectInfo,
type ChunkWriter interface {
// WriteChunk will write chunk number with reader bytes, where chunk number >= 0
WriteChunk(chunkNumber int, reader io.ReadSeeker) (bytesWritten int64, err error)
WriteChunk(ctx context.Context, chunkNumber int, reader io.ReadSeeker) (bytesWritten int64, err error)
// Close complete chunked writer
Close() error
Close(ctx context.Context) error
// Abort chunk write
Abort() error
Abort(ctx context.Context) error
}
// UserInfoer is an optional interface for Fs