This commit refactors out the complexity of downloading ordered WAL files in parallel to a type called `WALDownloader`. This makes it easier to test the restore separately from the download.
15 lines
240 B
Go
15 lines
240 B
Go
package mock
|
|
|
|
type ReadCloser struct {
|
|
CloseFunc func() error
|
|
ReadFunc func([]byte) (int, error)
|
|
}
|
|
|
|
func (r *ReadCloser) Close() error {
|
|
return r.CloseFunc()
|
|
}
|
|
|
|
func (r *ReadCloser) Read(b []byte) (int, error) {
|
|
return r.ReadFunc(b)
|
|
}
|