grafana / unused

CLI tool, Prometheus exporter, and Go module to list your unused disks in all cloud providers
Apache License 2.0
51 stars 1 forks source link

Consider consolidating CSP specific structs into single package #70

Open inkel opened 7 months ago

inkel commented 7 months ago

Currently all 3 implemented CSPs have their own package:

While this could be seen as a good idea it currently isn't, and it just adds additional indirection. This could be easily solved by making relatively small changes like the following (using GCP as an example):

Pokom commented 6 months ago

I guess it's going to depend on the future goals, and if there are plans to extend unused to other resources such as loadbalancers, service accounts, SQL instances etc. If so, each CSP exist in it's own package makes sense and isn't a level of indirection. If they exist within the same one, it's pretty easy for a developer to start pulling resources between providers and creating tight coupling between them. Having them as dedicated modules doesn't necessarily prevent this from happening, but makes it much more intentional as cyclical dependencies will become obvious during compilation.

inkel commented 6 months ago

🤔 yeah, I think you're right. In fact we could turn each provider package into its own Go module and release different versions for each one of them.