Rabarar's Blog

A blogging framework for mild hackers.

Gin and Martini: Go Have Fun With Web Services Frameworks!

| Comments

Building web services with Go is pretty straight-forward. See the godocs for http to see how to write both client and server code.

With a little more help, we can go beyond the standard Go packages and use a package web framework that accelerates the development of a web service stack. These frameworks do a few basic things:

1. Routing
2. Parameter Handling
3. JSON marshalling and unmarshalling
4. HTML templates and form processing

Below are two fo the frameworks that are VERY light weight and easy to use:

1. Martini
2. Gin

Basically both of these frameworks are very similar with the biggest difference being that Martini supports Dependency Injection. Gin uses a Context for its parameters.

  1. Martini
  2. Gin

Comments