4 ms·
For someone who hasn't invested much time into looking beyond the basic syntax of Go, can you give us a little info on what your stack looks like? I haven't go
by bratsche 13y ago
For someone who hasn't invested much time into looking beyond the basic syntax of Go, can you give us a little info on what your stack looks like?
I haven't gotten to the point where I've looked into things like web frameworks, templating engines, Postgres adapters, anything like that. But I'm interested in it.
- genwin 13y agoNiflet is my first foray into modern web development (I'm a database developer by day), so I kept it simple, just Go and SQLite. I'm using Go's webserver, which is basic but wasn't hard to extend to do compression and other niceties. Templating is via Go's template package. SQLite gets embedded, making the entire app a single 5 MB file. A free Dropbox account is used for nightly backup, handled by a scheduled goroutine (Go's concurrency feature). For a heavyweight web app that needs to scale to multiple machines I would've done things differently. It turns out that Go is so fast that needing to scale would be a luxury problem for me. In theory I can serve 70M users spread over a 10-hour day for < $100 a month.
- sbov 13y agoThe standard library templating in Go is one of my favorite features. Between html.template and text.template, I probably use it in over half of the programs I've written.
- mseepgood 13y agoI love the context aware escaping in html/template. I haven't seen this in other template engines before.
- soccerdave 13y agoHow did you embed your templates into the binary?
- jackielii 13y agovia string literals http://golang.org/ref/spec#String_literals http://golang.org/ref/spec#String_literals
- genwin 13y agoThe templates are on disk and their contents passed to the template function on initialization. So yes, the app is not a single file. I forgot about these files because they rarely change, hence are rarely deployed.
- orangethirty 13y agoFor development, I have: Nginx as a front facing server. Go listening to a specific port. MySQL for general database operations. MongoDB to pass some data around. Shoot me an email. I'll get you up to speed quickly.
- AYBABTME 13y agoReal question; why do you put Nginx in front of Go? Is it because you have many apps?
- username111 13y agoI don't know why the parent comment does it but with nginx you can leverage things like caching out of the box. (Would mostly be used on static files, either generated or pre-made).
- deleted 13y ago[deleted]
- orangethirty 13y agoIts a search engine, and I have many services working together.
- sergiotapia 13y agoI'd like a copy-paste of that email as well! I'm learning Go by following the Tour and making some dumb 'university' level examples to get a feel for the language and I'd like to actually build a website with it. Sent you an email
- cnu 13y agoCan you do a blog post instead? Would help lot of developers like me who are looking into Go as the next programming language to learn.