-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Migrate Ember provider to new structure #50
Conversation
|
||
func getGridIntensityData() (map[string]GridIntensity, error) { | ||
data := map[string]GridIntensity{} | ||
func GetEmberGridIntensity() (map[string]EmberGridIntensity, error) { |
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.
This new pkg/internal/data
package means the data and logic for getting the data file is separate from the provider.
We could extend this for other data files or to add more Ember data. The internal name is so its clear this isn't part of the public API.
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.
I hadn't thought of this as an idea, but I really like it. It's also something we could use on any other libraries that use local data. 👍
} | ||
|
||
validFrom := time.Date(emberDataYear, 1, 1, 0, 0, 0, 0, time.UTC) | ||
validTo := time.Date(emberDataYear, 12, 31, 23, 59, 0, 0, time.UTC) |
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.
Here we set the time period for the data.
hey @rossf7 - this is good to merge in. Thanks! |
Towards #44