An API to get the hourly electricity price in Spain (PVPC) from the Esios API.
tairosonloa / pvpc-backend Goto Github PK
View Code? Open in Web Editor NEWAn API to get the hourly electricity price in Spain (PVPC) from https://api.esios.ree.es/
An API to get the hourly electricity price in Spain (PVPC) from https://api.esios.ree.es/
An API to get the hourly electricity price in Spain (PVPC) from the Esios API.
Once #4 is implemented, deploy and call endpoint via cron job or similar in a daily basis
Perhaps over NFS to NAS
More info: https://go.dev/blog/slog
Package doc: https://pkg.go.dev/log/slog
Vet check to ensure no mistakes when logging with parameters: https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/slog
It should allow to get and save both, current and next day prices
It could be great to perhaps move all the code in the main
function to a bootstrap
or run
function and unit test it
The fetch prices function from prices service will now accept a date.
If date is nil
, behavior keeps the same (look database and current date and check if we can get prices)
If date is not nil
, get prices for that date if not already in database
Print stack trace of custom errors when calling logger. Maybe create a new function ErrorStackTrace
or FatalStackTrace
that will get that info from the error and print it
Currently, API endpoints are not protected.
They should be protected. First, I need to check current requirements, so then I will know what is the best solution.
Some possible solutions:
Check for articles / repos / gin docs
Requirements:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.