Goal
- Today's goal is to finish the work of having a unified way to access local and remote repositories.
Plan
Change the
ClientRepositorytype to be anenuminstead ofstruct. This will make it possible forobnam/src/bin/cmd/mod::open_repositoryto return values for local or remote repositories. The current approach of using a trait means only one concrete type can be returned.Change anything else that's needed to reach the goal.
Notes
Made that change. Not entirely happy that
ClientRepositoryhasput_chunk(and similar for other operations), which mirrors entirely theBackupRepositorytrait method.ClientRepositorynow exists both to hide the local/remote distinction and to add specific methods for specific kinds of chunk.I guess I could move the specific methods into
BackupRepositoryas provided methods, but I'll let this simmer for a while first, to see if its worth it, later.Next I'll manually test that the client can use a local repository or a remote one, just by changing the configuration file.
That worked reasonably well. There's one caveat: the client does not yet have a repository-independent subcommand to find chunks in the repository. But as I don't need that yet, I'll worry about it later.
Then I need to update the subplot to do the verification I just did manually. This requires juggling daemons with Subplot and that's something I've never made comfortable. If nothing else, the test suite currently does not capture or show server log output, which makes debugging a pain. I really need to fix that soon.
Actually, that's easier than I thought.
daemonizelets me direct stderr to a file. But more work if I want to it in a way that fits subplot test logging otherwise. I'll leave it for later.Next, I need to tidy up use of the client configuration file so that the
repositoryfield is used, notserver_urlandserver_token. Done. I like dropping old junk, but sometimes the junk is necessary to make progress.All right, this should work, at least in tests.
Summary
- The Obnam client can now handle both local and remote repositories merely by specifying the right one in the configuration file. This is an important step towards usefulness.
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?