Giter VIP home page Giter VIP logo

twister's Introduction

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.

twister's People

Contributors

garyburd avatar stevela avatar michalderkacz avatar nictuku avatar

Stargazers

adamsxu avatar

Watchers

adamsxu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.