diff --git a/Makefile b/Makefile index fa5acbbf5..669a7fc42 100644 --- a/Makefile +++ b/Makefile @@ -100,5 +100,5 @@ coverage: go tool cover -html=tmp.cov coverage-repo: - go test --coverprofile tmp.cov github.com/kopia/kopia/block/... github.com/kopia/kopia/object/... github.com/kopia/kopia/repo/... + go test --coverprofile tmp.cov github.com/kopia/kopia/repo/block/... github.com/kopia/kopia/repo/object/... github.com/kopia/kopia/repo/... go tool cover -html=tmp.cov diff --git a/cli/app.go b/cli/app.go index 104e59613..1ecb0c7e4 100644 --- a/cli/app.go +++ b/cli/app.go @@ -7,11 +7,11 @@ "os" "time" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/internal/kopialogging" "github.com/kopia/kopia/internal/serverapi" "github.com/kopia/kopia/repo" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/storage" kingpin "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/cli/command_block_index_recover.go b/cli/command_block_index_recover.go index c0bb49963..eb89fc5b0 100644 --- a/cli/command_block_index_recover.go +++ b/cli/command_block_index_recover.go @@ -3,9 +3,9 @@ import ( "context" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/repo" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/storage" ) var ( diff --git a/cli/command_block_index_show.go b/cli/command_block_index_show.go index c5b6392a6..959b0f61e 100644 --- a/cli/command_block_index_show.go +++ b/cli/command_block_index_show.go @@ -9,8 +9,8 @@ "github.com/kopia/kopia/internal/packindex" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/block" ) var ( diff --git a/cli/command_block_list.go b/cli/command_block_list.go index 6f013025f..4cab719b2 100644 --- a/cli/command_block_list.go +++ b/cli/command_block_list.go @@ -5,8 +5,8 @@ "fmt" "sort" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/block" ) var ( diff --git a/cli/command_block_rewrite.go b/cli/command_block_rewrite.go index acc0d3d99..eb775959e 100644 --- a/cli/command_block_rewrite.go +++ b/cli/command_block_rewrite.go @@ -6,8 +6,8 @@ "strings" "sync" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/block" ) var ( diff --git a/cli/command_block_stats.go b/cli/command_block_stats.go index 62367138c..e7f8ea547 100644 --- a/cli/command_block_stats.go +++ b/cli/command_block_stats.go @@ -6,9 +6,9 @@ "sort" "strconv" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/internal/units" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/block" ) var ( diff --git a/cli/command_ls.go b/cli/command_ls.go index 7fafb2438..c17380cde 100644 --- a/cli/command_ls.go +++ b/cli/command_ls.go @@ -8,8 +8,8 @@ "github.com/kopia/kopia/fs" "github.com/kopia/kopia/fs/repofs" - "github.com/kopia/kopia/object" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/object" ) const timeFormat = "2006-01-02 15:04:05" diff --git a/cli/command_object_show.go b/cli/command_object_show.go index 46622370b..b11dd3251 100644 --- a/cli/command_object_show.go +++ b/cli/command_object_show.go @@ -4,8 +4,8 @@ "context" "io" - "github.com/kopia/kopia/object" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/object" ) var ( diff --git a/cli/command_object_verify.go b/cli/command_object_verify.go index 8b5e5253d..61fb0ab0c 100644 --- a/cli/command_object_verify.go +++ b/cli/command_object_verify.go @@ -9,12 +9,12 @@ "sync" "time" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/fs" "github.com/kopia/kopia/fs/repofs" "github.com/kopia/kopia/internal/parallelwork" - "github.com/kopia/kopia/object" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/object" "github.com/kopia/kopia/snapshot" ) diff --git a/cli/command_repository_cache.go b/cli/command_repository_cache.go index 760143d01..160204480 100644 --- a/cli/command_repository_cache.go +++ b/cli/command_repository_cache.go @@ -3,8 +3,8 @@ import ( "context" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/block" ) var ( diff --git a/cli/command_repository_connect.go b/cli/command_repository_connect.go index b53a8fe57..36aab0e23 100644 --- a/cli/command_repository_connect.go +++ b/cli/command_repository_connect.go @@ -4,9 +4,9 @@ "context" "time" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/repo" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/storage" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/cli/command_repository_create.go b/cli/command_repository_create.go index 2ae2941aa..99366dc99 100644 --- a/cli/command_repository_create.go +++ b/cli/command_repository_create.go @@ -5,11 +5,11 @@ "errors" "fmt" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/internal/units" - "github.com/kopia/kopia/object" "github.com/kopia/kopia/repo" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/object" + "github.com/kopia/kopia/repo/storage" ) var ( diff --git a/cli/command_repository_migrate.go b/cli/command_repository_migrate.go index ec4eb1d32..defaf2c71 100644 --- a/cli/command_repository_migrate.go +++ b/cli/command_repository_migrate.go @@ -5,10 +5,10 @@ "fmt" "github.com/kopia/kopia/fs/repofs" - "github.com/kopia/kopia/object" + "github.com/kopia/kopia/internal/upload" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/object" "github.com/kopia/kopia/snapshot" - "github.com/kopia/kopia/upload" ) var ( diff --git a/cli/command_snapshot_create.go b/cli/command_snapshot_create.go index c376f071f..6eaac99aa 100644 --- a/cli/command_snapshot_create.go +++ b/cli/command_snapshot_create.go @@ -12,10 +12,10 @@ "strings" "time" + "github.com/kopia/kopia/internal/upload" "github.com/kopia/kopia/policy" "github.com/kopia/kopia/repo" "github.com/kopia/kopia/snapshot" - "github.com/kopia/kopia/upload" ) const ( diff --git a/cli/command_snapshot_list.go b/cli/command_snapshot_list.go index e8ffbaf87..390e71c7e 100644 --- a/cli/command_snapshot_list.go +++ b/cli/command_snapshot_list.go @@ -9,9 +9,9 @@ "github.com/kopia/kopia/fs" "github.com/kopia/kopia/fs/repofs" "github.com/kopia/kopia/internal/units" - "github.com/kopia/kopia/object" "github.com/kopia/kopia/policy" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/object" "github.com/kopia/kopia/snapshot" ) diff --git a/cli/command_storage_list.go b/cli/command_storage_list.go index b638160df..c92c1361b 100644 --- a/cli/command_storage_list.go +++ b/cli/command_storage_list.go @@ -5,7 +5,7 @@ "fmt" "github.com/kopia/kopia/repo" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" ) var ( diff --git a/cli/config.go b/cli/config.go index 1305da242..85d92b06b 100644 --- a/cli/config.go +++ b/cli/config.go @@ -11,12 +11,12 @@ "strings" "github.com/bgentry/speakeasy" - "github.com/kopia/kopia/auth" "github.com/kopia/kopia/fs" "github.com/kopia/kopia/fs/localfs" "github.com/kopia/kopia/fs/loggingfs" "github.com/kopia/kopia/internal/ospath" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/auth" ) var ( diff --git a/cli/objref.go b/cli/objref.go index 5e1d7b3f3..61e24755e 100644 --- a/cli/objref.go +++ b/cli/objref.go @@ -7,8 +7,8 @@ "github.com/kopia/kopia/fs" "github.com/kopia/kopia/fs/repofs" - "github.com/kopia/kopia/object" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/object" ) // ParseObjectID interprets the given ID string and returns corresponding object.ID. diff --git a/cli/progress.go b/cli/progress.go index 788c159af..6e4c87109 100644 --- a/cli/progress.go +++ b/cli/progress.go @@ -8,8 +8,8 @@ "time" "github.com/cheggaaa/pb" + "github.com/kopia/kopia/internal/upload" "github.com/kopia/kopia/snapshot" - "github.com/kopia/kopia/upload" ) type uploadProgress struct { diff --git a/cli/storage_providers.go b/cli/storage_providers.go index c3d7c5ba5..d55ed29e9 100644 --- a/cli/storage_providers.go +++ b/cli/storage_providers.go @@ -4,7 +4,7 @@ "context" "fmt" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" kingpin "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/examples/repository/main.go b/examples/repository/main.go index 1450673bf..2917fa7a8 100644 --- a/examples/repository/main.go +++ b/examples/repository/main.go @@ -5,9 +5,9 @@ "context" "os" - "github.com/kopia/kopia/auth" "github.com/kopia/kopia/internal/kopialogging" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/auth" ) var log = kopialogging.Logger("kopia/example") diff --git a/examples/repository/setup_repository.go b/examples/repository/setup_repository.go index 29f49a01c..213bfcf9a 100644 --- a/examples/repository/setup_repository.go +++ b/examples/repository/setup_repository.go @@ -5,11 +5,11 @@ "fmt" "os" - "github.com/kopia/kopia/auth" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/repo" - "github.com/kopia/kopia/storage/filesystem" - "github.com/kopia/kopia/storage/logging" + "github.com/kopia/kopia/repo/auth" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/storage/filesystem" + "github.com/kopia/kopia/repo/storage/logging" ) const ( diff --git a/examples/repository/upload_download_objects.go b/examples/repository/upload_download_objects.go index 3708074f2..7ec3fd6aa 100644 --- a/examples/repository/upload_download_objects.go +++ b/examples/repository/upload_download_objects.go @@ -6,8 +6,8 @@ "io/ioutil" "os" - "github.com/kopia/kopia/object" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/object" ) func uploadRandomObject(ctx context.Context, r *repo.Repository, length int) (object.ID, error) { diff --git a/fs/cachefs/cache.go b/fs/cachefs/cache.go index 140d7542c..568fba74d 100644 --- a/fs/cachefs/cache.go +++ b/fs/cachefs/cache.go @@ -7,7 +7,7 @@ "github.com/kopia/kopia/fs" "github.com/kopia/kopia/internal/kopialogging" - "github.com/kopia/kopia/object" + "github.com/kopia/kopia/repo/object" ) var log = kopialogging.Logger("kopia/cachefs") diff --git a/fs/repofs/repofs.go b/fs/repofs/repofs.go index adcd66191..c172cdf37 100644 --- a/fs/repofs/repofs.go +++ b/fs/repofs/repofs.go @@ -8,8 +8,8 @@ "github.com/kopia/kopia/fs" "github.com/kopia/kopia/internal/dir" - "github.com/kopia/kopia/object" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/object" "github.com/kopia/kopia/snapshot" ) diff --git a/internal/config/local_config.go b/internal/config/local_config.go index 2acdf99b7..eb1d85896 100644 --- a/internal/config/local_config.go +++ b/internal/config/local_config.go @@ -5,8 +5,8 @@ "io" "os" - "github.com/kopia/kopia/block" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/storage" ) // LocalConfig is a configuration of Kopia. diff --git a/internal/dir/entry.go b/internal/dir/entry.go index a69f4a8e9..74dc379f1 100644 --- a/internal/dir/entry.go +++ b/internal/dir/entry.go @@ -2,7 +2,7 @@ import ( "github.com/kopia/kopia/fs" - "github.com/kopia/kopia/object" + "github.com/kopia/kopia/repo/object" ) // Entry represents a directory entry as stored in JSON stream. diff --git a/internal/hashcache/hashcache.go b/internal/hashcache/hashcache.go index 92fa6f1f3..a7cc4db42 100644 --- a/internal/hashcache/hashcache.go +++ b/internal/hashcache/hashcache.go @@ -1,7 +1,7 @@ // Package hashcache implements streaming cache of file hashes. package hashcache -import "github.com/kopia/kopia/object" +import "github.com/kopia/kopia/repo/object" var hashCacheStreamType = "kopia:hashcache" diff --git a/internal/server/source_manager.go b/internal/server/source_manager.go index cd3588d76..df35478a8 100644 --- a/internal/server/source_manager.go +++ b/internal/server/source_manager.go @@ -7,9 +7,9 @@ "github.com/kopia/kopia/fs/localfs" "github.com/kopia/kopia/internal/serverapi" + "github.com/kopia/kopia/internal/upload" "github.com/kopia/kopia/policy" "github.com/kopia/kopia/snapshot" - "github.com/kopia/kopia/upload" ) // sourceManager manages the state machine of each source diff --git a/internal/serverapi/serverapi.go b/internal/serverapi/serverapi.go index ed16675a8..040b011bf 100644 --- a/internal/serverapi/serverapi.go +++ b/internal/serverapi/serverapi.go @@ -3,8 +3,8 @@ import ( "time" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/policy" + "github.com/kopia/kopia/repo/block" "github.com/kopia/kopia/snapshot" ) diff --git a/internal/storagetesting/asserts.go b/internal/storagetesting/asserts.go index db1f4a8db..bf722a4a4 100644 --- a/internal/storagetesting/asserts.go +++ b/internal/storagetesting/asserts.go @@ -9,7 +9,7 @@ "runtime" "testing" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" ) // AssertGetBlock asserts that the specified storage block has correct content. diff --git a/internal/storagetesting/faulty.go b/internal/storagetesting/faulty.go index c8fc47bd4..4fd816086 100644 --- a/internal/storagetesting/faulty.go +++ b/internal/storagetesting/faulty.go @@ -6,7 +6,7 @@ "time" "github.com/kopia/kopia/internal/kopialogging" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" ) var log = kopialogging.Logger("faulty-storage") diff --git a/internal/storagetesting/map.go b/internal/storagetesting/map.go index f5f2f7e80..c3f5ff9fe 100644 --- a/internal/storagetesting/map.go +++ b/internal/storagetesting/map.go @@ -8,7 +8,7 @@ "sync" "time" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" ) type mapStorage struct { diff --git a/internal/storagetesting/verify.go b/internal/storagetesting/verify.go index 6e67a1988..8df7c7780 100644 --- a/internal/storagetesting/verify.go +++ b/internal/storagetesting/verify.go @@ -5,7 +5,7 @@ "context" "testing" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" ) // VerifyStorage verifies the behavior of the specified storage. diff --git a/upload/upload.go b/internal/upload/upload.go similarity index 99% rename from upload/upload.go rename to internal/upload/upload.go index 6eaa2186b..368a02b0a 100644 --- a/upload/upload.go +++ b/internal/upload/upload.go @@ -20,8 +20,8 @@ "github.com/kopia/kopia/internal/dir" "github.com/kopia/kopia/internal/hashcache" "github.com/kopia/kopia/internal/kopialogging" - "github.com/kopia/kopia/object" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/object" "github.com/kopia/kopia/snapshot" ) diff --git a/upload/upload_progress.go b/internal/upload/upload_progress.go similarity index 100% rename from upload/upload_progress.go rename to internal/upload/upload_progress.go diff --git a/upload/upload_test.go b/internal/upload/upload_test.go similarity index 98% rename from upload/upload_test.go rename to internal/upload/upload_test.go index d8beb9c6a..71caae7dc 100644 --- a/upload/upload_test.go +++ b/internal/upload/upload_test.go @@ -9,12 +9,12 @@ "reflect" "testing" - "github.com/kopia/kopia/auth" "github.com/kopia/kopia/internal/mockfs" - "github.com/kopia/kopia/object" "github.com/kopia/kopia/repo" + "github.com/kopia/kopia/repo/auth" + "github.com/kopia/kopia/repo/object" + "github.com/kopia/kopia/repo/storage/filesystem" "github.com/kopia/kopia/snapshot" - "github.com/kopia/kopia/storage/filesystem" ) type uploadTestHarness struct { diff --git a/main.go b/main.go index bad490491..0963f6f69 100644 --- a/main.go +++ b/main.go @@ -30,10 +30,10 @@ logging "github.com/op/go-logging" - _ "github.com/kopia/kopia/storage/filesystem/cli" - _ "github.com/kopia/kopia/storage/gcs/cli" - _ "github.com/kopia/kopia/storage/s3/cli" - _ "github.com/kopia/kopia/storage/webdav/cli" + _ "github.com/kopia/kopia/repo/storage/filesystem/cli" + _ "github.com/kopia/kopia/repo/storage/gcs/cli" + _ "github.com/kopia/kopia/repo/storage/s3/cli" + _ "github.com/kopia/kopia/repo/storage/webdav/cli" ) var fileLogFormat = logging.MustStringFormatter( diff --git a/policy/policy_manager.go b/policy/policy_manager.go index beee4ea72..57937b2c0 100644 --- a/policy/policy_manager.go +++ b/policy/policy_manager.go @@ -8,7 +8,7 @@ "github.com/kopia/kopia/fs/ignorefs" "github.com/kopia/kopia/internal/kopialogging" - "github.com/kopia/kopia/manifest" + "github.com/kopia/kopia/repo/manifest" "github.com/kopia/kopia/repo" "github.com/kopia/kopia/snapshot" ) diff --git a/auth/auth_options.go b/repo/auth/auth_options.go similarity index 100% rename from auth/auth_options.go rename to repo/auth/auth_options.go diff --git a/auth/creds.go b/repo/auth/creds.go similarity index 100% rename from auth/creds.go rename to repo/auth/creds.go diff --git a/auth/key_manager.go b/repo/auth/key_manager.go similarity index 100% rename from auth/key_manager.go rename to repo/auth/key_manager.go diff --git a/auth/master_key_creds.go b/repo/auth/master_key_creds.go similarity index 100% rename from auth/master_key_creds.go rename to repo/auth/master_key_creds.go diff --git a/auth/password_creds.go b/repo/auth/password_creds.go similarity index 100% rename from auth/password_creds.go rename to repo/auth/password_creds.go diff --git a/block/block_cache.go b/repo/block/block_cache.go similarity index 97% rename from block/block_cache.go rename to repo/block/block_cache.go index 221019db3..4d7349440 100644 --- a/block/block_cache.go +++ b/repo/block/block_cache.go @@ -9,8 +9,8 @@ "sync" "time" - "github.com/kopia/kopia/storage" - "github.com/kopia/kopia/storage/filesystem" + "github.com/kopia/kopia/repo/storage" + "github.com/kopia/kopia/repo/storage/filesystem" ) const ( diff --git a/block/block_cache_test.go b/repo/block/block_cache_test.go similarity index 98% rename from block/block_cache_test.go rename to repo/block/block_cache_test.go index eb9f64bd0..9e27ee10b 100644 --- a/block/block_cache_test.go +++ b/repo/block/block_cache_test.go @@ -10,7 +10,7 @@ "testing" "github.com/kopia/kopia/internal/storagetesting" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" ) func newUnderlyingStorageForBlockCacheTesting() storage.Storage { diff --git a/block/block_formatter.go b/repo/block/block_formatter.go similarity index 100% rename from block/block_formatter.go rename to repo/block/block_formatter.go diff --git a/block/block_formatter_test.go b/repo/block/block_formatter_test.go similarity index 100% rename from block/block_formatter_test.go rename to repo/block/block_formatter_test.go diff --git a/block/block_formatting_options.go b/repo/block/block_formatting_options.go similarity index 100% rename from block/block_formatting_options.go rename to repo/block/block_formatting_options.go diff --git a/block/block_index_recovery.go b/repo/block/block_index_recovery.go similarity index 100% rename from block/block_index_recovery.go rename to repo/block/block_index_recovery.go diff --git a/block/block_manager.go b/repo/block/block_manager.go similarity index 99% rename from block/block_manager.go rename to repo/block/block_manager.go index c67256a04..4d81e1976 100644 --- a/block/block_manager.go +++ b/repo/block/block_manager.go @@ -19,7 +19,7 @@ "github.com/kopia/kopia/internal/kopialogging" "github.com/kopia/kopia/internal/packindex" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" ) var log = kopialogging.Logger("kopia/block") diff --git a/block/block_manager_test.go b/repo/block/block_manager_test.go similarity index 99% rename from block/block_manager_test.go rename to repo/block/block_manager_test.go index dcc28401e..0f703860d 100644 --- a/block/block_manager_test.go +++ b/repo/block/block_manager_test.go @@ -16,7 +16,7 @@ "github.com/kopia/kopia/internal/packindex" "github.com/kopia/kopia/internal/storagetesting" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" logging "github.com/op/go-logging" ) diff --git a/block/cache_hmac.go b/repo/block/cache_hmac.go similarity index 100% rename from block/cache_hmac.go rename to repo/block/cache_hmac.go diff --git a/block/caching_options.go b/repo/block/caching_options.go similarity index 100% rename from block/caching_options.go rename to repo/block/caching_options.go diff --git a/block/committed_block_index.go b/repo/block/committed_block_index.go similarity index 98% rename from block/committed_block_index.go rename to repo/block/committed_block_index.go index 354fe138b..3d67f6d18 100644 --- a/block/committed_block_index.go +++ b/repo/block/committed_block_index.go @@ -6,7 +6,7 @@ "sync" "github.com/kopia/kopia/internal/packindex" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" ) type committedBlockIndex struct { diff --git a/block/committed_block_index_disk_cache.go b/repo/block/committed_block_index_disk_cache.go similarity index 100% rename from block/committed_block_index_disk_cache.go rename to repo/block/committed_block_index_disk_cache.go diff --git a/block/committed_block_index_mem_cache.go b/repo/block/committed_block_index_mem_cache.go similarity index 100% rename from block/committed_block_index_mem_cache.go rename to repo/block/committed_block_index_mem_cache.go diff --git a/block/context.go b/repo/block/context.go similarity index 100% rename from block/context.go rename to repo/block/context.go diff --git a/block/list_cache.go b/repo/block/list_cache.go similarity index 98% rename from block/list_cache.go rename to repo/block/list_cache.go index a09fde2d2..e8f0a22f8 100644 --- a/block/list_cache.go +++ b/repo/block/list_cache.go @@ -9,7 +9,7 @@ "path/filepath" "time" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" ) type listCache struct { diff --git a/block/stats.go b/repo/block/stats.go similarity index 100% rename from block/stats.go rename to repo/block/stats.go diff --git a/repo/connect.go b/repo/connect.go index 392dc5739..e56c03632 100644 --- a/repo/connect.go +++ b/repo/connect.go @@ -9,12 +9,12 @@ "os" "path/filepath" - "github.com/kopia/kopia/auth" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/internal/config" "github.com/kopia/kopia/internal/ospath" "github.com/kopia/kopia/internal/units" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/auth" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/storage" ) // ConnectOptions specifies options when persisting configuration to connect to a repository. diff --git a/repo/format_block.go b/repo/format_block.go index 6ad8ddbf9..302e0e77f 100644 --- a/repo/format_block.go +++ b/repo/format_block.go @@ -10,9 +10,9 @@ "fmt" "io" - "github.com/kopia/kopia/auth" "github.com/kopia/kopia/internal/config" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/auth" + "github.com/kopia/kopia/repo/storage" ) // FormatBlockID is the identifier of a storage block that describes repository format. diff --git a/repo/initialize.go b/repo/initialize.go index cd93390a2..cb750c52b 100644 --- a/repo/initialize.go +++ b/repo/initialize.go @@ -6,11 +6,11 @@ "fmt" "io" - "github.com/kopia/kopia/auth" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/internal/config" - "github.com/kopia/kopia/object" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/auth" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/object" + "github.com/kopia/kopia/repo/storage" ) // BuildInfo is the build information of Kopia. diff --git a/manifest/manifest_entry.go b/repo/manifest/manifest_entry.go similarity index 100% rename from manifest/manifest_entry.go rename to repo/manifest/manifest_entry.go diff --git a/manifest/manifest_manager.go b/repo/manifest/manifest_manager.go similarity index 99% rename from manifest/manifest_manager.go rename to repo/manifest/manifest_manager.go index 35c3f94a9..a910c62f2 100644 --- a/manifest/manifest_manager.go +++ b/repo/manifest/manifest_manager.go @@ -13,9 +13,9 @@ "sync" "time" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/internal/kopialogging" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/storage" ) var log = kopialogging.Logger("kopia/manifest") diff --git a/manifest/manifest_manager_test.go b/repo/manifest/manifest_manager_test.go similarity index 99% rename from manifest/manifest_manager_test.go rename to repo/manifest/manifest_manager_test.go index 39519d086..a4b151ab4 100644 --- a/manifest/manifest_manager_test.go +++ b/repo/manifest/manifest_manager_test.go @@ -8,8 +8,8 @@ "testing" "time" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/internal/storagetesting" + "github.com/kopia/kopia/repo/block" ) func TestManifest(t *testing.T) { diff --git a/manifest/serialized.go b/repo/manifest/serialized.go similarity index 100% rename from manifest/serialized.go rename to repo/manifest/serialized.go diff --git a/object/indirect.go b/repo/object/indirect.go similarity index 100% rename from object/indirect.go rename to repo/object/indirect.go diff --git a/object/object_manager.go b/repo/object/object_manager.go similarity index 99% rename from object/object_manager.go rename to repo/object/object_manager.go index 9d790bcea..73acaa435 100644 --- a/object/object_manager.go +++ b/repo/object/object_manager.go @@ -8,9 +8,9 @@ "io" "sync" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/internal/config" "github.com/kopia/kopia/internal/jsonstream" + "github.com/kopia/kopia/repo/block" ) // Reader allows reading, seeking, getting the length of and closing of a repository object. diff --git a/object/object_manager_test.go b/repo/object/object_manager_test.go similarity index 99% rename from object/object_manager_test.go rename to repo/object/object_manager_test.go index 4ddfb8681..aae6c1d03 100644 --- a/object/object_manager_test.go +++ b/repo/object/object_manager_test.go @@ -15,11 +15,11 @@ "sync" "testing" - "github.com/kopia/kopia/block" + "github.com/kopia/kopia/repo/block" "github.com/kopia/kopia/internal/config" "github.com/kopia/kopia/internal/jsonstream" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" ) type fakeBlockManager struct { diff --git a/object/object_reader.go b/repo/object/object_reader.go similarity index 100% rename from object/object_reader.go rename to repo/object/object_reader.go diff --git a/object/object_splitter.go b/repo/object/object_splitter.go similarity index 100% rename from object/object_splitter.go rename to repo/object/object_splitter.go diff --git a/object/object_splitter_test.go b/repo/object/object_splitter_test.go similarity index 100% rename from object/object_splitter_test.go rename to repo/object/object_splitter_test.go diff --git a/object/object_writer.go b/repo/object/object_writer.go similarity index 100% rename from object/object_writer.go rename to repo/object/object_writer.go diff --git a/object/objectid.go b/repo/object/objectid.go similarity index 100% rename from object/objectid.go rename to repo/object/objectid.go diff --git a/object/objectid_test.go b/repo/object/objectid_test.go similarity index 100% rename from object/objectid_test.go rename to repo/object/objectid_test.go diff --git a/object/semaphore.go b/repo/object/semaphore.go similarity index 100% rename from object/semaphore.go rename to repo/object/semaphore.go diff --git a/object/writeback.go b/repo/object/writeback.go similarity index 100% rename from object/writeback.go rename to repo/object/writeback.go diff --git a/repo/open.go b/repo/open.go index 0a1a0320e..d58e61eb4 100644 --- a/repo/open.go +++ b/repo/open.go @@ -8,14 +8,14 @@ "io/ioutil" "path/filepath" - "github.com/kopia/kopia/auth" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/internal/config" "github.com/kopia/kopia/internal/kopialogging" - "github.com/kopia/kopia/manifest" - "github.com/kopia/kopia/object" - "github.com/kopia/kopia/storage" - "github.com/kopia/kopia/storage/logging" + "github.com/kopia/kopia/repo/auth" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/manifest" + "github.com/kopia/kopia/repo/object" + "github.com/kopia/kopia/repo/storage" + "github.com/kopia/kopia/repo/storage/logging" ) var log = kopialogging.Logger("kopia/repo") diff --git a/repo/repository.go b/repo/repository.go index 3950b5284..27ed24a11 100644 --- a/repo/repository.go +++ b/repo/repository.go @@ -5,11 +5,11 @@ "fmt" "time" - "github.com/kopia/kopia/auth" - "github.com/kopia/kopia/block" - "github.com/kopia/kopia/manifest" - "github.com/kopia/kopia/object" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/auth" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/manifest" + "github.com/kopia/kopia/repo/object" + "github.com/kopia/kopia/repo/storage" ) // Repository represents storage where both content-addressable and user-addressable data is kept. diff --git a/repo/repository_test.go b/repo/repository_test.go index ba3d392f9..428b1d760 100644 --- a/repo/repository_test.go +++ b/repo/repository_test.go @@ -14,11 +14,11 @@ "testing" "time" - "github.com/kopia/kopia/auth" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/internal/storagetesting" - "github.com/kopia/kopia/object" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/auth" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/object" + "github.com/kopia/kopia/repo/storage" ) func setupTest(t *testing.T, mods ...func(o *NewRepositoryOptions)) (map[string][]byte, map[string]time.Time, *Repository) { diff --git a/storage/config.go b/repo/storage/config.go similarity index 100% rename from storage/config.go rename to repo/storage/config.go diff --git a/storage/doc.go b/repo/storage/doc.go similarity index 100% rename from storage/doc.go rename to repo/storage/doc.go diff --git a/storage/filesystem/cli/filesystemcli.go b/repo/storage/filesystem/cli/filesystemcli.go similarity index 95% rename from storage/filesystem/cli/filesystemcli.go rename to repo/storage/filesystem/cli/filesystemcli.go index 048c3ae12..8ff029808 100644 --- a/storage/filesystem/cli/filesystemcli.go +++ b/repo/storage/filesystem/cli/filesystemcli.go @@ -6,8 +6,8 @@ "strconv" "github.com/kopia/kopia/cli" - "github.com/kopia/kopia/storage" - "github.com/kopia/kopia/storage/filesystem" + "github.com/kopia/kopia/repo/storage" + "github.com/kopia/kopia/repo/storage/filesystem" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/storage/filesystem/filesystem_options.go b/repo/storage/filesystem/filesystem_options.go similarity index 100% rename from storage/filesystem/filesystem_options.go rename to repo/storage/filesystem/filesystem_options.go diff --git a/storage/filesystem/filesystem_storage.go b/repo/storage/filesystem/filesystem_storage.go similarity index 99% rename from storage/filesystem/filesystem_storage.go rename to repo/storage/filesystem/filesystem_storage.go index 5bb1fa458..4fd954bc2 100644 --- a/storage/filesystem/filesystem_storage.go +++ b/repo/storage/filesystem/filesystem_storage.go @@ -12,7 +12,7 @@ "strings" "github.com/kopia/kopia/internal/kopialogging" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" ) var log = kopialogging.Logger("kopia/filesystem") diff --git a/storage/filesystem/filesystem_storage_test.go b/repo/storage/filesystem/filesystem_storage_test.go similarity index 100% rename from storage/filesystem/filesystem_storage_test.go rename to repo/storage/filesystem/filesystem_storage_test.go diff --git a/storage/gcs/cli/gcscli.go b/repo/storage/gcs/cli/gcscli.go similarity index 92% rename from storage/gcs/cli/gcscli.go rename to repo/storage/gcs/cli/gcscli.go index b66e77d6a..390fdb31d 100644 --- a/storage/gcs/cli/gcscli.go +++ b/repo/storage/gcs/cli/gcscli.go @@ -4,8 +4,8 @@ "context" "github.com/kopia/kopia/cli" - "github.com/kopia/kopia/storage" - "github.com/kopia/kopia/storage/gcs" + "github.com/kopia/kopia/repo/storage" + "github.com/kopia/kopia/repo/storage/gcs" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/storage/gcs/gcs_options.go b/repo/storage/gcs/gcs_options.go similarity index 100% rename from storage/gcs/gcs_options.go rename to repo/storage/gcs/gcs_options.go diff --git a/storage/gcs/gcs_storage.go b/repo/storage/gcs/gcs_storage.go similarity index 99% rename from storage/gcs/gcs_storage.go rename to repo/storage/gcs/gcs_storage.go index 411c83e5c..0164a9894 100644 --- a/storage/gcs/gcs_storage.go +++ b/repo/storage/gcs/gcs_storage.go @@ -12,7 +12,7 @@ "github.com/efarrer/iothrottler" "github.com/kopia/kopia/internal/retry" "github.com/kopia/kopia/internal/throttle" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" "golang.org/x/oauth2" "golang.org/x/oauth2/google" "google.golang.org/api/iterator" diff --git a/storage/logging/logging_storage.go b/repo/storage/logging/logging_storage.go similarity index 98% rename from storage/logging/logging_storage.go rename to repo/storage/logging/logging_storage.go index 517eac60a..d930c630e 100644 --- a/storage/logging/logging_storage.go +++ b/repo/storage/logging/logging_storage.go @@ -6,7 +6,7 @@ "time" "github.com/kopia/kopia/internal/kopialogging" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" ) var log = kopialogging.Logger("kopia/storage") diff --git a/storage/logging/logging_storage_test.go b/repo/storage/logging/logging_storage_test.go similarity index 100% rename from storage/logging/logging_storage_test.go rename to repo/storage/logging/logging_storage_test.go diff --git a/storage/progress.go b/repo/storage/progress.go similarity index 100% rename from storage/progress.go rename to repo/storage/progress.go diff --git a/storage/providers/providers.go b/repo/storage/providers/providers.go similarity index 63% rename from storage/providers/providers.go rename to repo/storage/providers/providers.go index d9a09f42f..540e3dc3b 100644 --- a/storage/providers/providers.go +++ b/repo/storage/providers/providers.go @@ -3,6 +3,6 @@ import ( // Register well-known blob storage providers - _ "github.com/kopia/kopia/storage/filesystem" - _ "github.com/kopia/kopia/storage/gcs" + _ "github.com/kopia/kopia/repo/storage/filesystem" + _ "github.com/kopia/kopia/repo/storage/gcs" ) diff --git a/storage/registry.go b/repo/storage/registry.go similarity index 100% rename from storage/registry.go rename to repo/storage/registry.go diff --git a/storage/s3/cli/s3cli.go b/repo/storage/s3/cli/s3cli.go similarity index 94% rename from storage/s3/cli/s3cli.go rename to repo/storage/s3/cli/s3cli.go index fe130f720..bb437ed08 100644 --- a/storage/s3/cli/s3cli.go +++ b/repo/storage/s3/cli/s3cli.go @@ -4,8 +4,8 @@ "context" "github.com/kopia/kopia/cli" - "github.com/kopia/kopia/storage" - "github.com/kopia/kopia/storage/s3" + "github.com/kopia/kopia/repo/storage" + "github.com/kopia/kopia/repo/storage/s3" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/storage/s3/s3_options.go b/repo/storage/s3/s3_options.go similarity index 100% rename from storage/s3/s3_options.go rename to repo/storage/s3/s3_options.go diff --git a/storage/s3/s3_storage.go b/repo/storage/s3/s3_storage.go similarity index 99% rename from storage/s3/s3_storage.go rename to repo/storage/s3/s3_storage.go index 49c54d18e..a2a9dd785 100644 --- a/storage/s3/s3_storage.go +++ b/repo/storage/s3/s3_storage.go @@ -10,7 +10,7 @@ "github.com/efarrer/iothrottler" "github.com/kopia/kopia/internal/retry" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" "github.com/minio/minio-go" ) diff --git a/storage/s3/s3_storage_test.go b/repo/storage/s3/s3_storage_test.go similarity index 98% rename from storage/s3/s3_storage_test.go rename to repo/storage/s3/s3_storage_test.go index 14a6bc45b..2fe93f22b 100644 --- a/storage/s3/s3_storage_test.go +++ b/repo/storage/s3/s3_storage_test.go @@ -12,7 +12,7 @@ "time" "github.com/kopia/kopia/internal/storagetesting" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" "github.com/minio/minio-go" ) diff --git a/storage/storage.go b/repo/storage/storage.go similarity index 100% rename from storage/storage.go rename to repo/storage/storage.go diff --git a/storage/storage_test.go b/repo/storage/storage_test.go similarity index 97% rename from storage/storage_test.go rename to repo/storage/storage_test.go index 306200f50..9b666f217 100644 --- a/storage/storage_test.go +++ b/repo/storage/storage_test.go @@ -6,7 +6,7 @@ "time" "github.com/kopia/kopia/internal/storagetesting" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" ) func TestListAllBlocksConsistent(t *testing.T) { diff --git a/storage/webdav/cli/webdavcli.go b/repo/storage/webdav/cli/webdavcli.go similarity index 89% rename from storage/webdav/cli/webdavcli.go rename to repo/storage/webdav/cli/webdavcli.go index f1fbbcef3..3a5c34f70 100644 --- a/storage/webdav/cli/webdavcli.go +++ b/repo/storage/webdav/cli/webdavcli.go @@ -4,8 +4,8 @@ "context" "github.com/kopia/kopia/cli" - "github.com/kopia/kopia/storage" - "github.com/kopia/kopia/storage/webdav" + "github.com/kopia/kopia/repo/storage" + "github.com/kopia/kopia/repo/storage/webdav" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/storage/webdav/webdav_options.go b/repo/storage/webdav/webdav_options.go similarity index 100% rename from storage/webdav/webdav_options.go rename to repo/storage/webdav/webdav_options.go diff --git a/storage/webdav/webdav_props.go b/repo/storage/webdav/webdav_props.go similarity index 100% rename from storage/webdav/webdav_props.go rename to repo/storage/webdav/webdav_props.go diff --git a/storage/webdav/webdav_request.go b/repo/storage/webdav/webdav_request.go similarity index 100% rename from storage/webdav/webdav_request.go rename to repo/storage/webdav/webdav_request.go diff --git a/storage/webdav/webdav_storage.go b/repo/storage/webdav/webdav_storage.go similarity index 99% rename from storage/webdav/webdav_storage.go rename to repo/storage/webdav/webdav_storage.go index 7f7b3597c..b8aa2dbcc 100644 --- a/storage/webdav/webdav_storage.go +++ b/repo/storage/webdav/webdav_storage.go @@ -10,7 +10,7 @@ "strings" "github.com/kopia/kopia/internal/kopialogging" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/storage" ) var log = kopialogging.Logger("kopia/webdav") diff --git a/storage/webdav/webdav_storage_test.go b/repo/storage/webdav/webdav_storage_test.go similarity index 100% rename from storage/webdav/webdav_storage_test.go rename to repo/storage/webdav/webdav_storage_test.go diff --git a/snapshot/manager.go b/snapshot/manager.go index 1ec9b5ee6..64e684ab7 100644 --- a/snapshot/manager.go +++ b/snapshot/manager.go @@ -2,7 +2,7 @@ import ( "github.com/kopia/kopia/internal/kopialogging" - "github.com/kopia/kopia/manifest" + "github.com/kopia/kopia/repo/manifest" "github.com/kopia/kopia/repo" ) diff --git a/snapshot/manifest.go b/snapshot/manifest.go index b412d3c01..170b726c3 100644 --- a/snapshot/manifest.go +++ b/snapshot/manifest.go @@ -6,7 +6,7 @@ "github.com/kopia/kopia/internal/dir" - "github.com/kopia/kopia/object" + "github.com/kopia/kopia/repo/object" ) // Manifest represents information about a single point-in-time filesystem snapshot. diff --git a/snapshot/stats.go b/snapshot/stats.go index 081efc8bc..c474daea1 100644 --- a/snapshot/stats.go +++ b/snapshot/stats.go @@ -1,8 +1,8 @@ package snapshot import ( - "github.com/kopia/kopia/block" "github.com/kopia/kopia/fs" + "github.com/kopia/kopia/repo/block" ) // Stats keeps track of snapshot generation statistics. diff --git a/tests/repository_stress_test/repository_stress_test.go b/tests/repository_stress_test/repository_stress_test.go index d0e724353..bc3239e49 100644 --- a/tests/repository_stress_test/repository_stress_test.go +++ b/tests/repository_stress_test/repository_stress_test.go @@ -14,11 +14,11 @@ "testing" "time" - "github.com/kopia/kopia/auth" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/repo" - "github.com/kopia/kopia/storage" - "github.com/kopia/kopia/storage/filesystem" + "github.com/kopia/kopia/repo/auth" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/storage" + "github.com/kopia/kopia/repo/storage/filesystem" ) type testContext struct { diff --git a/tests/stress_test/stress_test.go b/tests/stress_test/stress_test.go index 237dfb6b8..0fac6e430 100644 --- a/tests/stress_test/stress_test.go +++ b/tests/stress_test/stress_test.go @@ -9,9 +9,9 @@ "testing" "time" - "github.com/kopia/kopia/block" "github.com/kopia/kopia/internal/storagetesting" - "github.com/kopia/kopia/storage" + "github.com/kopia/kopia/repo/block" + "github.com/kopia/kopia/repo/storage" ) const goroutineCount = 16