feat: Add event type and pre/post-index logging

This commit is contained in:
Felicitas Pojtinger
2021-12-15 02:06:18 +01:00
parent 479def3d80
commit ae7e418891
14 changed files with 117 additions and 18 deletions

View File

@@ -9,6 +9,7 @@ import (
"strings"
models "github.com/pojntfx/stfs/internal/db/sqlite/models/metadata"
"github.com/pojntfx/stfs/pkg/config"
"github.com/pojntfx/stfs/pkg/recovery"
)
@@ -57,7 +58,11 @@ func (o *Operations) Restore(from string, to string, flatten bool) error {
for _, dbhdr := range headersToRestore {
if o.onHeader != nil {
o.onHeader(dbhdr)
o.onHeader(&config.HeaderEvent{
Type: config.HeaderEventTypeRestore,
Indexed: true,
Header: dbhdr,
})
}
dst := dbhdr.Name