Skip to content

adamsxu/twister

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twister

Twister is fast, modular and lightweight framework for building applications in the Go programming language.

What's in the Box?

  • 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.

Hello, world

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)
}

Installation

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.

Documentation

  • 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.

Examples

  • 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.

License

Twister is available under the Apache License, Version 2.0.

Discussion

Discussion related to the use and development of Twister is held at the Twister Users group.

You can also contact the author through Github.

About

Twister was written by Gary Burd. The name "Twister" was inspired by Tornado.

About

Twister is a lightweight framework for writing web applications in Go.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published