Twister is fast, modular and lightweight framework for building applications in the Go programming language.
- Routing: Request to handler mapping with using regular expressions.
- Utilities: Static file server, file uploads, cookies, form data, headers and other HTTP meta-data.
- Server: Production quality HTTP server and adapter for Google App Engine.
Here is the canonical "Hello, world" example application for Twister:
package main
import (
"github.com/garyburd/twister/server"
"github.com/garyburd/twister/web"
"io"
)
func serveHello(req *web.Request) {
w := req.Respond(web.StatusOK, web.HeaderContentType, "text/plain; charset=\"utf-8\"")
io.WriteString(w, "Hello World!")
}
func main() {
h := web.NewRouter().Register("/", "GET", serveHello)
server.Run(":8080", h)
}
Twister requires a working Go development environment. The Getting Started document describes how to install the development environment. Once you have Go up and running, you can install Twister with a single command:
goinstall github.com/garyburd/twister/server
The Go distribution is Twister's only dependency.
- web - Defines the application interface to a server and includes functionality used by most web applications.
- server - An HTTP server impelemented in Go.
- oauth - OAuth client.
- websocket - WebSocket server implementation.
- expvar - Exports variables as JSON over HTTP for monitoring.
- pprof - Exports profiling data for the pprof tool.
- gae - Support for running Twister on Google App Engine.
- wiki - The Go web application example converted to use Twister instead of the Go http package.
- demo - Illustrates basic features of Twister.
- twitter - Login to Twitter with OAuth and display home timeline.
- facebook - Login to Facebook with OAuth2 and display news feed.
Twister is available under the Apache License, Version 2.0.
Discussion related to the use and development of Twister is held at the Twister Users group.
You can also contact the author through Github.
Twister was written by Gary Burd. The name "Twister" was inspired by Tornado.