Live data from Hacker News

Show HN: A simple Go web server with logging, tracing, health check

gist.github.com

81–90 of 97 posts

Re: Show HN: A simple Go web server with logging, tracing, health check

#81
post #62
post #46

Earlier quoted context omitted.

Because we're all using Go for other projects (even if piecemeal) and would like to build the entire project in a single language.

i personaly only would use go for very technical, low-level middlewares (as in, just above the OS layer) involving networks. The good side to it being simple to understand and maintain is that you won't pay a lot of debt if you're adding it to your stack. There isn't a single language that fits all use case perfectly anyway, so we'd have to just go to the "best tool for the job" approach in the meantime.

> i personaly only would use go for very technical, low-level middlewares.

Care to extend upon why you don't feel go is a good fit for other programming?

Re: Show HN: A simple Go web server with logging, tracing, health check

#82
post #58

Earlier quoted context omitted.

Nice. Does anyone have a server like this but with the addition of * serving of files and directories * LetsEncrypt certificates and SSL

The builtin golang.org/x/crypto/acme/autocert [0] package manages SSL for you easily through Lets Encrypt. [0]: https://godoc.org/golang.org/x/crypto/acme/autocert

golang.org/x/ packages are not builtin. You still must download them and use them just as you do any other dependencies, they just share some contribution process and developers with golang's stdlib.

Re: Show HN: A simple Go web server with logging, tracing, health check

#83
post #38

Here's a quick attempt at the same thing in Java (although note that the command line format is different): https://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 meth…

I've been developing in Java for around 20 years and I never knew the JDK included a web server. This must be the thing I learned today ;)

Re: Show HN: A simple Go web server with logging, tracing, health check

#84
post #38

Here's a quick attempt at the same thing in Java (although note that the command line format is different): https://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 meth…

Jetty does everything, else Spring with tomcat. I don't see any reason to rely on JDK web server (which I've never seen anyone seriouosly use.

Re: Show HN: A simple Go web server with logging, tracing, health check

#85
post #74

Earlier quoted context omitted.

Not sure if I would use Twitter as a success story for handling scale. Not exactly the poster boy of reliable software.

You're kidding, right? After they ditched ruby and wrote finagle, they've been super reliable. They've got one of the biggest Apache Mesos clusters in the world (second only to Apple's Siri backend per Apple employees who presented at MesosCon) and run it all with Apache Aurora, a really nice mesos framework for long running jobs. Twitter, Soundcloud, Salesforce, Pinterest, FitBit, Tumblr, Box, Foursquare... What do…

Is it Java or Scala? I only see Scala on this page: https://twitter.github.io/finagle/guide/Quickstart.html#a-mi...

Re: Show HN: A simple Go web server with logging, tracing, health check

#86
post #61

It's a nice reference program to show you what's going on. I build stuff like this for a living. I'd recommend not re-inventing the wheel yourself and using a nice web framework, like Echo ( https://github.com/labstack/echo ) or Gin ( https://github.com/gin-gonic/gin ). I prefer Echo due to a cleaner, mockable design, but they're equivalent. You can throw up that web server in 1/10 the code to do the same thing, and…

I tend to agree and I’d throw Chi in the mix. I like Chi quite a bit. Or, use the Gorilla components and middleware.

I also use Chi a lot and Chi and this example are actually complimentary: you can take the Chi router and pass it to an http.Server in the handler attribute to make it work.

Re: Show HN: A simple Go web server with logging, tracing, health check

#87
post #74

Earlier quoted context omitted.

You're kidding, right? After they ditched ruby and wrote finagle, they've been super reliable. They've got one of the biggest Apache Mesos clusters in the world (second only to Apple's Siri backend per Apple employees who presented at MesosCon) and run it all with Apache Aurora, a really nice mesos framework for long running jobs. Twitter, Soundcloud, Salesforce, Pinterest, FitBit, Tumblr, Box, Foursquare... What do…

Is it Java or Scala? I only see Scala on this page: https://twitter.github.io/finagle/guide/Quickstart.html#a-mi...

Finagle proper is written in Scala, but you can use java as well for building services with it:

https://github.com/jghoman/finagle-java-example

Re: Show HN: A simple Go web server with logging, tracing, health check

#88
post #76
post #34

This 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…

Look into https://github.com/markbates/pop

And the rest of Marks (and others) buffalo https://gobuffalo.io/

Re: Show HN: A simple Go web server with logging, tracing, health check

#89
post #78
post #40

Earlier quoted context omitted.

I regularly go down this road with go. My conclusion is that it's never going to suit that use case. I'm not even sure it's not technically doable (i think introspection and interface{} can go quite far), but it's just culturally opposed to this kind of project. 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 eve…

I’m the same way - I have lots of side project ideas I’d love to use Go for but get that early Rails like productivity. I maintain a few Rails apps and now view many of the things I’ve done as hacks to work around the lack of concurrency (though that was just Rails’ reality in late 2000s). Elixir is close to my ideal though I like static types and a better community around libs would be nice.

You might be interested to check out https://gobuffalo.io/

Re: Show HN: A simple Go web server with logging, tracing, health check

#90

Earlier quoted context omitted.

I like how you, as the owner of the repo and poster, agreed with me, yet I got -3 points...

Look at all the other gray comments here. Any comment questioning why this is so great appears to be severely triggering the masses.

Please don't break the HN guidelines by going on about voting in comments.

https://news.ycombinator.com/newsguidelines.html

Post reply on HN