datastore: add single-level and recursive namespace iterators

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht committed 2022-05-12 09:33:50 +02:00
1 parent 02ec2ae9b8
commit 90e3869690
3 files changed
+222 -6

No files matched your search

+9 -5
View File
@@ -12,12 +12,16 @@ fn run() -> Result<(), Error> {
let store = unsafe { DataStore::open_path("", &base, None)? };
for group in store.iter_backup_groups(Default::default())? {
let group = group?;
println!("found group {}", group);
for ns in store.recursive_iter_backup_ns_ok(Default::default())? {
println!("found namespace store:/{}", ns);
for snapshot in group.iter_snapshots()? {
println!("\t{}", snapshot?);
for group in store.iter_backup_groups(ns)? {
let group = group?;
println!(" found group {}", group);
for snapshot in group.iter_snapshots()? {
println!("\t{}", snapshot?);
}
}
}