here are a few options available, mainly in the form of what I would call a toolkit rather than a framework. My favourite right now is Gorilla, a really modular and simple to use web toolkit which helps with things like routing and sessions. There are more feature-rich things out there like web.go (a kind of light and simple web framework, mainly building blocks) and Revel (a much heavier option, modelled on the Play!framework for Scala/Java)
Personally though, I really don’t like the feeling of working with a framework for web development in Go, it’s an extremely clean and fun language to work with and has a bunch of handy, modular, well documented packages out of the box. I have built a couple of small applications using pure Go for handler functions, the net/http library for routing and serving, mgo as a MongoDB driver, Mustache for templates and Blackfriday for markdown parsing. I find this feels really light and nimble for development (more so than any framework I have seen thus far).
Good luck building web apps in Go!
Gorilla is a web toolkit for the Go programming language. Currently these packages are available:
- gorilla/context stores global request variables.
- gorilla/mux is a powerful URL router and dispatcher.
- gorilla/reverse produces reversible regular expressions for regexp-based muxes.
- gorilla/rpc implements RPC over HTTP with codec for JSON-RPC.
- gorilla/schema converts form values to a struct.
- gorilla/securecookie encodes and decodes authenticated and optionally encrypted cookie values.
- gorilla/sessions saves cookie and filesystem sessions and allows custom session backends.
Installation
Run “go get” pointing to a package. For example, to install gorilla/mux:
$ go get github.com/gorilla/mux
Or clone a repository and use the source code directly:
$ git clone git://github.com/gorilla/mux.git
For Google App Engine, create a directory tree inside your app and clone the repository there:
$ cd myapp $ mkdir -p github.com/gorilla $ cd github.com/gorilla $ git clone git://github.com/gorilla/mux.git
FAQ
Q: Is Gorilla a framework?
A: No, it is a toolkit. Just use what you need with your favorite framework or the http package.
A: No, it is a toolkit. Just use what you need with your favorite framework or the http package.
Q: Why the name Gorilla?
A: Because it starts with “Go”. Also, we want to raise awareness about endangered primates.
A: Because it starts with “Go”. Also, we want to raise awareness about endangered primates.
Q: Can I buy a fluffy toy of that tiny cute gorilla from your logo?
A: Not yet.
A: Not yet.
Testimonials
“Gorilla is fresh and tidy. It’s like wearing recently washed underpants.” — Geekoid, on Hacker News
“I wish Gorilla was written in Haskell.” — Rasmus Jørgensen, Haskell developer
“Come on… what’s next? Goldfish? Goat? Goose?!?” — AnonymousCoward, on Reddit
Discussion
Join the gorilla-web mailing list.
from http://www.gorillatoolkit.org/
No comments:
Post a Comment