Lots of code in different stores can be consolidated
discentem opened this issue · comments
https://github.com/discentem/cavorite/blob/main/internal/stores/s3.go#L120-L153
and
https://github.com/discentem/cavorite/blob/main/internal/stores/gcs.go#L69-L92
are identical. Instead maintaining this code in each of the store providers (and future providers), we should abstract this out.
@natewalck do you feel that this issue is resolved by #111?
Not entirely.
#111 still does config checking within the store. (Specifically, checking for the metadata extension config to exist)
If a config is required for cavorite to run, we should be checking it and bailing (or set a default) in the code that is reading the config. This should live here: https://github.com/discentem/cavorite/blob/main/internal/cli/init.go#L72
The config code should own the config validation, if that makes sense.
Closing this. Opened #113 to keep track of the config validation changes @natewalck is requesting