Resources for golang web development.
- render json
- render text
- set headers
- serve a file
- parse an url
- parse a json request
- nesting templates
- multipart-form processing
Introductory articles and tutorials
writing web applications - official golang tutorial
how i start - tutorial demonstrating how to setup a basic REST API
building your own web framework - very nice series of articles (in 5 parts) describing how to roll-your own custom framework with context-aware handler chains
building web applications - free e-book covering the basics
Useful packages for creating and processing form data include:
How to share context and functionality
If you're using a middleware pattern to process HTTP requests in Go, you may want to share some data or context between middleware handlers and your application handlers.
painless web handlers - sharing context by creating a new
handlertype with a
basic auth example - with
example of wrapping your handlers with a closure for composiblity.
For material specifically focused on HTTP API / web service development, see this gist.
The gorilla web toolkit provides a fairly comprehensive set of web utility packages.
Other stuff ...
- gin - live reloading
- negroni - bidirectional middleware flow
- render - improved templating
- sqlx - convenient extensions to
- cors - CORS middleware
- goth - multi-provider authentication
- goji - a basic router providing request context
- gorilla/context - registry for global request variables
- go-form-it - easy form creation and handling