docker-volume-backup icon indicating copy to clipboard operation
docker-volume-backup copied to clipboard

Define abstract interface for storage backends

Open m90 opened this issue 3 years ago • 0 comments

@m90 Great! Quick question: there is quite a bit of similar code for the different types of storages. Would you be open to generalize the code a bit? In a OOP language I would create a common abstract class with with abstract functions like listFiles, uploadFile, removeFile, and so on. Then it's simply a matter of implementing each storage in its own class. This would allow, for instance, to have a single purge function. I'm guessing the go equivalent would be something similar to this.

I know that it's a bit out of scope for this issue, but I'd like to hear your thoughts on this. Also, there to consider the possibility that a single storage jack-of-all-trades like rclone will be the way to go in the future (as per #65); in this case abstracting the current storages like this will probably be a waste of time.

Originally posted by @MMauro94 in https://github.com/offen/docker-volume-backup/issues/94#issuecomment-1123224662

m90 avatar Jun 23 '22 12:06 m90