forked from TrueCloudLab/restic
Add comments for List()
This commit is contained in:
parent
b0c6e53241
commit
685ce719ad
2 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue