Rename snapshots.Manager => exporter.Exporter
This commit is contained in:
parent
063f3f9b7d
commit
8d2855fdcb
23 changed files with 105 additions and 100 deletions
|
|
@ -1,33 +0,0 @@
|
|||
package snapshots
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
type WithManifest struct {
|
||||
Manifest []string
|
||||
}
|
||||
|
||||
func (wm *WithManifest) handleManifest(dest string) (chan<- string, func()) {
|
||||
manifest := make(chan string)
|
||||
done := make(chan struct{})
|
||||
go func() {
|
||||
defer close(done)
|
||||
|
||||
for file := range manifest {
|
||||
// get the relative path to the root of the manifest.
|
||||
// nothing *should* go wrong, but in case it does, use the original path.
|
||||
path, err := filepath.Rel(dest, file)
|
||||
if err != nil {
|
||||
path = file
|
||||
}
|
||||
|
||||
// add the manifest
|
||||
wm.Manifest = append(wm.Manifest, path)
|
||||
}
|
||||
}()
|
||||
return manifest, func() {
|
||||
close(manifest)
|
||||
<-done
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue