yurenyong123 / gem

a simple and fast web framework written in Go(golang), for building restful or web application, it built on top of fasthttp.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gem GoDoc Build Status Go Report Card Coverage Status Join the chat at https://gitter.im/go-gem/gem

Gem, a simple and fast web framework, it built top of fasthttp.

Install

go get github.com/go-gem/gem

Features

Performance

Gem benchmark

Parameter Info
Date 2016-11-01
Go Version 1.7.1
OS Ubuntu 16.04.1 LTS
CPU Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz 8 Cores
Memory 8G

The benchmark comes from my laptop, I have send a pull request to go-web-framework-benchmark, waiting for merging and rerunning the benchmark.

Quick Start

package main

import (
    "log"
    
    "github.com/go-gem/gem"
)

func main() {
	log.Fatal(gem.ListenAndServe(":8080", func(ctx *gem.Context) {
        ctx.HTML(200, "Hello world.")
    }))
}

Run the code above, and then navigate to 127.0.0.1:8080.

Wiki

Examples

Semantic Versioning

Gem follows semantic versioning 2.0.0 managed through GitHub releases.

Support Us

  • the project.
  • Spread the word.
  • Contribute to the project.

Contribute

We’re always looking for help, so if you would like to contribute, we’d love to have you!

Motivation

Just for figuring out the web framework's workflow, and try to design a simple and strong web framework.

Related Packages

  • tests - a tests package for fasthttp and Gem.
  • sessions - a sessions manager package for fasthttp.
  • log - a simple, leveled logging package.

FAQ

  1. What should I pay attention to?

    At present, Gem is incompatible with some APIs of fasthttp, the incompatible APIs following:

    • fasthttp.TimeoutHandler
  2. What is the difference between of fasthttp and gem?

    Gem built on top of fasthttp, and use Server.ServeConn to serve connections, it can not works without fasthttp.

    Advantages:

    Gem provides some useful built-in features, such as:

    • High-performance router
    • Leveled logger
    • Various middlewares
    • Sessions support
    • Graceful shutdown and restart

    Disadvantages:

    At present, Gem dose not provide APIs to Serve the custom Listener like fasthttp.Serve.

LICENSE

MIT licensed. See LICENSE file for more information.

Inspiration & Credits

I have read the code of the following open source projects, and integrate their designs into this project.

I respect these projects and it's authors, and follow their LICENSE.

If your LICENSE is missing, please contact me, I will add it ASAP.

About

a simple and fast web framework written in Go(golang), for building restful or web application, it built on top of fasthttp.

License:Other


Languages

Language:Go 100.0%