diff --git a/internal/restic/backend.go b/internal/restic/backend.go index 07d0c1739..51198215f 100644 --- a/internal/restic/backend.go +++ b/internal/restic/backend.go @@ -34,6 +34,9 @@ type Backend interface { // List runs fn for each file in the backend which has the type t. When an // error occurs (or fn returns an error), List stops and returns it. + // + // The function fn is called in the same Goroutine that List() is called + // from. List(ctx context.Context, t FileType, fn func(FileInfo) error) error // IsNotExist returns true if the error was caused by a non-existing file diff --git a/internal/restic/repository.go b/internal/restic/repository.go index f1da9770c..1ab4a2766 100644 --- a/internal/restic/repository.go +++ b/internal/restic/repository.go @@ -26,7 +26,12 @@ type Repository interface { LookupBlobSize(ID, BlobType) (uint, error) - List(context.Context, FileType, func(ID, int64) error) error + // List calls the function fn for each file of type t in the repository. + // When an error is returned by fn, processing stops and List() returns the + // error. + // + // The function fn is called in the same Goroutine List() was called from. + List(ctx context.Context, t FileType, fn func(ID, int64) error) error ListPack(context.Context, ID) ([]Blob, int64, error) Flush(context.Context) error