Add interface to get version of item
Pass version as UID in OwnerInfo to kopia to allow more control of what kopia thinks is a cached file.
This commit is contained in:
parent
41d5550b4b
commit
0928e53a8b
@ -87,6 +87,10 @@ type StreamModTime interface {
|
||||
ModTime() time.Time
|
||||
}
|
||||
|
||||
type Versioner interface {
|
||||
Version() uint32
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// functionality
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -339,9 +339,15 @@ func collectionEntries(
|
||||
modTime = smt.ModTime()
|
||||
}
|
||||
|
||||
o := fs.OwnerInfo{}
|
||||
if sv, ok := e.(data.Versioner); ok {
|
||||
o.UserID = sv.Version()
|
||||
}
|
||||
|
||||
entry := virtualfs.StreamingFileWithModTimeFromReader(
|
||||
encodedName,
|
||||
modTime,
|
||||
o,
|
||||
newBackupStreamReader(serializationVersion, e.ToReader()),
|
||||
)
|
||||
if err := cb(ctx, entry); err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user