Goal

  • Today I'm going to do more tidying up. In the near future I'm going to need begin work on actual backups, but I'll want the foundation to be strong and clean by then. Also, it's warm and I'm tired.

Plan

  • Change the client so that the LocalRepositoryError error type never used except for local repositories, in the obnam/src/bin/cmd/mod.rs module.

  • Change the client command line parser to be able to have Id and Label types by implementing a value parser.

  • Any refactoring or other code tidy up I find that needs doing while browsing the code.

Notes

  • Looked at making the error type for repository commands more generic. That will require obnam/src/repo.rs, which is meant to be an interface independent from where the chunk are stored, to not expose errors from BlobRepository, which is inherently on the local disk. Changing this will require more surgery than I have time or energy for today. It will be part of the greater effort of hiding local vs remote chunk storage. An aspect here is that the BackupRepository trait lets the implementer choose the error type, which leads to the fact that the local repository error is used, because for now only local repositories are supported.

  • Actually, why does the server have the Repo type in obnam-server/src/repo.rs instead of using BlobRepository directly? The Repo type provides a thin wrapper around BlobRepository, and I don't think that's worth it. Dropped that.

  • Renamed MainError to ObnamError.

  • Added a Makefile target check, as an alias to clippy, to match my various other projects.

  • Added a FromStr implementation for Id, which allows the type to be used directly with clap for command line arguments. Likewise for chunk labels. This was easier than I thought, I do like clap.

  • Merged.

Summary

  • Did some tidying up that future me will be happy for.

Support?

If you'd like to fund Obnam development, see my funding page. My high level goal is described on the architecture page. What is most important about backup software to you?