repo: refactored read/write methods of repo.Repository (#749)

Reader methods go to repo.Reader and write methods go to repo.Writer
Switched usage to new interfaces based on linter errors.
This commit is contained in:
Jarek Kowalski
2021-01-04 21:33:12 -08:00
committed by GitHub
parent d947f795f4
commit 5e8e175cfa
48 changed files with 164 additions and 146 deletions

View File

@@ -21,7 +21,7 @@
diffCommandCommand = diffCommand.Flag("diff-command", "Displays differences between two repository objects (files or directories)").Default(defaultDiffCommand()).Envar("KOPIA_DIFF").String()
)
func runDiffCommand(ctx context.Context, rep repo.Repository) error {
func runDiffCommand(ctx context.Context, rep repo.Reader) error {
ent1, err := snapshotfs.FilesystemEntryFromIDWithPath(ctx, rep, *diffFirstObjectPath, false)
if err != nil {
return errors.Wrapf(err, "error getting filesystem entry for %v", *diffFirstObjectPath)
@@ -67,5 +67,5 @@ func defaultDiffCommand() string {
}
func init() {
diffCommand.Action(repositoryAction(runDiffCommand))
diffCommand.Action(repositoryReaderAction(runDiffCommand))
}