Show HN: A simple Go web server with logging, tracing, health check
31–40 of 97 posts
Re: Show HN: A simple Go web server with logging, tracing, health check
#32Re: Show HN: A simple Go web server with logging, tracing, health check
#33Earlier quoted context omitted.
Hi chrisper, you are right! This is just a reminder for me on how to do those things when I start a new app in Go, instead of always google for them.
I like how you, as the owner of the repo and poster, agreed with me, yet I got -3 points...
Re: Show HN: A simple Go web server with logging, tracing, health check
#34https://beego.me and https://iris-go.com are nice, but we (all) have (as yet) to find a Django-like framework that comes with an extensible back-office.
So... Any pointers on the latter? I can do an Ask HN, but this seems like a good context to ask in.
(Edited to add: why the downvotes? Is this not a legitimate question?)
Re: Show HN: A simple Go web server with logging, tracing, health check
#35This is likely better posted as a Show HN if it meets the guidelines: https://news.ycombinator.com/showhn.html
Re: Show HN: A simple Go web server with logging, tracing, health check
#36This reminds me of an ongoing discussion I was having with friends about Golang web frameworks -- one side of the argument is that you can achieve so much with the standard library that frameworks are "unnecessary", but folk like me want an ORM(ish) layer and some kind of back-office scaffolding. https://beego.me and https://iris-go.com are nice, but we (all) have (as yet) to find a Django-like framework that comes w…
See the drama unfold at https://www.reddit.com/r/golang/comments/57w79c/why_you_real... and https://www.reddit.com/r/golang/comments/57tmp1/why_you_shou...
Re: Show HN: A simple Go web server with logging, tracing, health check
#37This is likely better posted as a Show HN if it meets the guidelines: https://news.ycombinator.com/showhn.html
Hi grzm, you are probably right. Can I do this myself? editing the title with a "Show HN" prefix is sufficient?
Re: Show HN: A simple Go web server with logging, tracing, health check
#38https://gist.github.com/tomwhoiscontrary/b4888b86057c74a636c...
The main takeaway is that the JDK's built-in web server is poor:
* There is no way to configure timeouts
* Filters have to be added to each handler separately, by mucking with its filter list
* Filters have to extend an abstract class with two methods (one totally pointless), so you can't use lambdas for them
* Handlers use a simple string prefix match, so a request for "/healthzone" will hit the health handler
* The stop method always blocks for the specified timeout, and never returns early as the docs promise (IME)
Other minor irritations:
* There is no method to parse an InetSocketAddress from a string
* Java's support for handling clean process shutdown is not great; i think there's some sort of race between the shutdown hook and the logging system getting shut down, so you never see the "Server stopped" message
Re: Show HN: A simple Go web server with logging, tracing, health check
#39This reminds me of an ongoing discussion I was having with friends about Golang web frameworks -- one side of the argument is that you can achieve so much with the standard library that frameworks are "unnecessary", but folk like me want an ORM(ish) layer and some kind of back-office scaffolding. https://beego.me and https://iris-go.com are nice, but we (all) have (as yet) to find a Django-like framework that comes w…
- julienschmidt/httprouter [1] for routing,
- jmoiron/sqlx [2] for SQL access, and
- gorilla/websocket [3] for websockets
sqlx isn't an ORM; it's more a convenience wrapper around the standard library's database/sql package.
gorm is the nicest ORM I've found, but I think even the well-written ORM packages are unnatural to use because of restrictions in Go's type system.
(Sorry if this isn't the kind of answer you were hoping for.)
[1] https://github.com/julienschmidt/httprouter
Re: Show HN: A simple Go web server with logging, tracing, health check
#40This reminds me of an ongoing discussion I was having with friends about Golang web frameworks -- one side of the argument is that you can achieve so much with the standard library that frameworks are "unnecessary", but folk like me want an ORM(ish) layer and some kind of back-office scaffolding. https://beego.me and https://iris-go.com are nice, but we (all) have (as yet) to find a Django-like framework that comes w…
People like go for its minimalist approach. Not in the sense that you don't have a lot of code to write, but more in the sense that you are in control of everything that happens, and that you can read an understand every part of your codebase.
ORMs , code gen, magic wrappers, etc is something that people in that community just hate.