Code Monkey home page Code Monkey logo

air's Introduction

Air

Build Status codecov Go Report Card GoDoc

An ideal RESTful web framework for Go. You can use it to develop a RESTful web application as natural as breathing.

High-performance? Fastest? Almost all the web frameworks are using these words to tell people that they are the best. Maybe they are, maybe not. This framework does not intend to follow the crowd. So, Air web framework can only guarantee you one thing: it can serve properly.

Features

  • APIs
    • As less as possible.
    • As simple as possible.
    • As expressive as possible.
  • HTTP Methods (only four)
    • GET
    • POST
    • PUT
    • DELETE
  • Server
    • HTTP/2 support.
    • SSL/TLS support.
    • Gracefully shutdown support.
    • Powered by the Go net/http.
  • Router
    • Based on the Radix Tree.
    • Zero dynamic memory allocation.
    • Has a good inspection mechanism.
    • Group routes support.
  • Gas (also called middleware)
    • Router level:
      • Before router.
      • After router.
    • Route level.
    • Group level.
  • Config
    • For server.
    • For logger.
    • For renderer.
    • For coffer.
    • For everything.
    • Configuration file support by using the toml.
  • Logger
    • Customizable.
    • Default implementation:
      • Powered by the Go text/template.
  • Binder
    • Customizable.
    • Default implementation:
      • Based on the Content-Type header.
      • Supported MIME types:
        • application/json.
        • application/xml.
        • application/x-www-form-urlencoded.
  • Minifier
    • Customizable.
    • Default implementation:
      • Supported MIME types:
        • text/html
        • text/css
        • text/javascript
        • application/json
        • text/xml
        • image/jpeg
        • image/png
        • image/svg+xml
      • Powered by the Go image and the minify.
  • Renderer
    • Customizable.
    • Default implementation:
      • Rich template functions.
      • Hot update support by using the fsnotify.
      • Powered by the Go html/template.
  • Coffer
    • Customizable.
    • Accesses binary asset files by using the runtime memory.
    • Reduces the hard disk I/O and significantly improves the performance of the Response#File().
    • Default implementation:
      • Asset file minimization:
        • .html
        • .css
        • .js
        • .json
        • .xml
        • .svg
      • Hot update support by using the fsnotify.
  • HTTPError
    • Customizable.
    • Centralized handling.

Installation

Open your terminal and execute

$ go get github.com/sheng/air

done.

The only requirement is the Go, at least v1.8.

Hello, 世界

Create a file named hello.go

package main

import "github.com/sheng/air"

func main() {
	a := air.New()
	a.GET("/", homeHandler)
	a.Serve()
}

func homeHandler(c *air.Context) error {
	return c.String("Hello, 世界")
}

and run it

$ go run hello.go

then visit http://localhost:2333.

Documentation

Gases

As we all know that the air is a mixture of gases. So the same is that this framework adopts the gas as its composition. Everyone can create new gas and use it within this framework simply.

If you want to learn more about the gases, or create your own gas for this framework, simply visit here.

Examples

If you want to be familiar with this framework as soon as possible, simply visit here.

Community

If you want to discuss this framework, or ask questions about it, simply post questions or ideas here.

Contributing

If you want to help build this framework, simply follow these to send pull requests here.

License

This project is licensed under the Unlicense.

License can be found here.

air's People

Contributors

aleksi avatar

Watchers

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