From 302619a11ab2a093b5647364bfce89bac176edb2 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 14 Aug 2016 18:12:07 +0200 Subject: [PATCH] Move interfaces to package restic/types --- src/restic/index/index.go | 10 +++++----- src/restic/{ => types}/repository.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) rename src/restic/{ => types}/repository.go (96%) diff --git a/src/restic/index/index.go b/src/restic/index/index.go index 9426fced4..d2f0d9856 100644 --- a/src/restic/index/index.go +++ b/src/restic/index/index.go @@ -5,11 +5,11 @@ import ( "errors" "fmt" "os" - "restic" "restic/backend" "restic/debug" "restic/list" "restic/pack" + "restic/types" "restic/worker" ) @@ -41,7 +41,7 @@ func newIndex() *Index { } // New creates a new index for repo from scratch. -func New(repo restic.Repository) (*Index, error) { +func New(repo types.Repository) (*Index, error) { done := make(chan struct{}) defer close(done) @@ -92,7 +92,7 @@ type indexJSON struct { Packs []*packJSON `json:"packs"` } -func loadIndexJSON(repo restic.Repository, id backend.ID) (*indexJSON, error) { +func loadIndexJSON(repo types.Repository, id backend.ID) (*indexJSON, error) { debug.Log("index.loadIndexJSON", "process index %v\n", id.Str()) var idx indexJSON @@ -105,7 +105,7 @@ func loadIndexJSON(repo restic.Repository, id backend.ID) (*indexJSON, error) { } // Load creates an index by loading all index files from the repo. -func Load(repo restic.Repository) (*Index, error) { +func Load(repo types.Repository) (*Index, error) { debug.Log("index.Load", "loading indexes") done := make(chan struct{}) @@ -268,7 +268,7 @@ func (idx *Index) FindBlob(h pack.Handle) ([]Location, error) { } // Save writes a new index containing the given packs. -func Save(repo restic.Repository, packs map[backend.ID][]pack.Blob, supersedes backend.IDs) (backend.ID, error) { +func Save(repo types.Repository, packs map[backend.ID][]pack.Blob, supersedes backend.IDs) (backend.ID, error) { idx := &indexJSON{ Supersedes: supersedes, Packs: make([]*packJSON, 0, len(packs)), diff --git a/src/restic/repository.go b/src/restic/types/repository.go similarity index 96% rename from src/restic/repository.go rename to src/restic/types/repository.go index e35de0e94..d13d93333 100644 --- a/src/restic/repository.go +++ b/src/restic/types/repository.go @@ -1,4 +1,4 @@ -package restic +package types import ( "restic/backend"