aboutsummaryrefslogtreecommitdiff
path: root/repo
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-10-18 16:00:08 +0200
committern-peugnet <n.peugnet@free.fr>2021-10-18 16:00:08 +0200
commit04563efa9c0dc1f6a36094dfd884ae432cf46b29 (patch)
treebe5a78647bec2a6d5812fb8b61b4ac4fcd3744b7 /repo
parent5539220a8839519becd45b63be65ed86fa9286a4 (diff)
downloaddna-backup-04563efa9c0dc1f6a36094dfd884ae432cf46b29.tar.gz
dna-backup-04563efa9c0dc1f6a36094dfd884ae432cf46b29.zip
add intermediate export package no to make repo dependant on dna
Diffstat (limited to 'repo')
-rw-r--r--repo/export.go (renamed from repo/export_dir.go)8
1 files changed, 3 insertions, 5 deletions
diff --git a/repo/export_dir.go b/repo/export.go
index bffa7f0..dd12077 100644
--- a/repo/export_dir.go
+++ b/repo/export.go
@@ -20,18 +20,16 @@ package repo
import (
"io"
- "github.com/n-peugnet/dna-backup/dna"
+ "github.com/n-peugnet/dna-backup/export"
"github.com/n-peugnet/dna-backup/logger"
- "github.com/n-peugnet/dna-backup/utils"
)
-func (r *Repo) ExportDir(dest string, trackSize int) {
+func (r *Repo) Export(exporter export.Exporter) {
r.Init()
- exporter := dna.New(dest, 96, trackSize, 10000, utils.ZlibWriter, utils.ZlibReader)
chunks := r.loadChunks(r.versions)
for i := range r.versions {
var err error
- input, end := exporter.VersionInput()
+ input, end := exporter.ExportVersion()
if len(chunks[i]) > 0 {
for _, c := range chunks[i] {
_, err := io.Copy(input.Chunks, c.Reader())