Martini: Classy web development in Go
martini.codegangsta.io
Martini: Classy web development in Go
1–10 of 30 posts
Re: Martini: Classy web development in Go
#2Re: Martini: Classy web development in Go
#3Re: Martini: Classy web development in Go
#4Are you looking to make this more full featured with an ORM/persistence layer (i.e Rails) or keep it small and similar to Sinatra?
Re: Martini: Classy web development in Go
#5Re: Martini: Classy web development in Go
#6By a happy coincidence, I was just going to start building an API backend in Go today or tomorrow for a side project, and was thinking about doing it with vanilla Go but now I'll probably give Martini a shot (!).
Re: Martini: Classy web development in Go
#7Would be really nice if the demo was in a normal web page instead of a video. (Also, I'd love to know what vim(?) extension provides the interactive completion with the function signatures! That looks really cool.)
Re: Martini: Classy web development in Go
#8Seems to be missing documentation.
In fact, having now read the rest of the code, they're pretty much comprehensive.
Re: Martini: Classy web development in Go
#9Very cool. Reminiscent of express.js, but statically typed and in Go. I may look at this for future projects.
Re: Martini: Classy web development in Go
#10I particularly like the service injection concept. Django forces every view function to take a request object and return a response object. Flask makes these optional, but then requires you to use global variables to access more information from the request. Martini attempts to resolve any arguments it sees by looking up their static type against a service directory. I think that's really clever.
The way it allows you to stack up Handlers is neat too. Django does this with either globally applied middleware or per-view-function decorators, but there's something really neat about just taking a list of functions for things like authentication and "stacking" them on top of each other - or having that same function applied as middleware to every request using m.Use(func...). Using Context.Next() to allow that middleware to "wrap" a request (the equivalent of Django's process_request and process_response pair) is clever as well.
Colour me impressed!