mirror of
https://github.com/restic/restic.git
synced 2026-10-08 03:17:12 +00:00
Remove Each(), add basic stats
This commit is contained in:
1 parent
4bb7f2f2ed
commit
b6f25aa690
6 files changed
+82
-71
No files matched your search
@@ -24,30 +24,6 @@ var (
|
||||
|
||||
const hashSize = sha256.Size
|
||||
|
||||
// Each lists all entries of type t in the backend and calls function f() with
|
||||
// the id and data.
|
||||
func Each(be interface {
|
||||
Lister
|
||||
Getter
|
||||
}, t Type, f func(id ID, data []byte, err error)) error {
|
||||
ids, err := be.List(t)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, id := range ids {
|
||||
data, err := be.Get(t, id)
|
||||
if err != nil {
|
||||
f(id, nil, err)
|
||||
continue
|
||||
}
|
||||
|
||||
f(id, data, nil)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Each lists all entries of type t in the backend and calls function f() with
|
||||
// the id.
|
||||
func EachID(be Lister, t Type, f func(ID)) error {
|
||||
|
||||
Reference in new issue
Block a user