Hi,
I’m working my way through the web development with Go Udemy course by Todd McLeod and really enjoying and benefitting from it. So much so that I have been able to build my first html reports using Go templates. I really enjoyed building that as it bound together a large number of techniques into a something ‘real’.
I’m moving on now to a project which I suspect is going to be a challenge.
I want to build a dashboard style webpage which will pull data (metrics) from a handful of different sources (using SQL/Rest) and render them as a composite view of a particular environment. I know html/css/javascript/jquery reasonably well and I wish to hook these metrics up to instrumentation widgets to produce a professional looking application.
I will need the dashboard to refresh every 30s or so, which I don’t think should be too tricky as it only takes Go about 8s to complete all the GET’s and Query’s needed to populate the map which I am injecting into the template.
Where I would appreciate opinions/advice:
-
Thus far I have been using the simple webserver boilerplate code from Todd’s training section 6. lecture 46 ‘creating a static file server with Go’. Its great for serving up the dashboard… that should work fine for the initial render of the page/template - but I can’t see how to handle the 30s refresh needed. Should I serve the page as one Go channel/routine and then run the creation of the page in another? They should work okay together to produce the desired effect, right? Or is there a better way to handle it?
-
For the application I have described, would I be better using Node.js for the webserver side and Go for the creation of the content being served up?
-
My progress with Go so far seems to be based on a lot of blood and tears, just about getting what I want/need, then someone comes along and says… “Oh, you could have used xxxx”, then when I look at xxxx they are right and I go back and redo it. This time I’d really like to research and choose in advance which packages will work well for me.
-
Anyone know of any starter or demo projects that do this kind of thing to give me something to study?
Would appreciate any thoughts/guidance.
Many thanks!