-
-
Notifications
You must be signed in to change notification settings - Fork 3
#7 Usde Singleton and interfaces for refactor WIP #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
I don't think I follow based on reading your code, but I do like the provider registration approach. Does it turn into a map or using reflection to match the type it needs to price? I'm a bit confused on what the difference between a TerraformPriceableAsset and an AzurePriceableAsset is? Maybe we can setup a call and talk through this. Like I said, I think I like the direction I just need audible words to understand it. My brain is mush after these exams 😂 |
|
Does this address #7 ? |
|
No reflection it just takes the change type and matches that string to anything coming from keys() method. Azure priceable asset was something you made to help the code work with generate query. The terrform priceable asset allows any change from tf to turn into a priceable
|
7f5f693 to
6233f34
Compare
|
@zparnold okay finished implementation, I need to mrege conflicts but what do you think? |
1319df6 to
da0546c
Compare
| ) | ||
|
|
||
| func init() { | ||
| ctx := context.Background() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zparnold here is the init register. This allows us to add packages without touching main.go
@zparnold I have a POC on this. Please let me know if you like this direction and I will finish
The basic Idea here is move the logic of determinig what
Priceableassets match theChange.Type(s) into the actual pricer files. This lets main be more generic and removes the big switch.I want to see if you like this direction before I keep going. The next Idea was to do the following.
init()magic to have them register themselves with theTerraformAssetPricerInestiableResourceErrorto represent the error when we cant estimate and make a single AssetPricer for that.Change.Addressso that we can price individual resources(line item break down) in the future. Main then can loop over price results and show total, cost by resource, cost by X thing