Fast and Reliable Golang Web Framework

Overview

Gramework

codecov Build Status CII Best Practices Backers on Open Collective Sponsors on Open Collective FOSSA Status Reviewed by Hound

The Good Framework

Gramework Stats Screenshot

Gramework long-term testing stand metrics screenshot made with Gramework Stats Dashboard and metrics middleware

What is it?

Gramework is a fast, highly effective, reliable, SPA-first, go-way web framework made by a fasthttp maintainer. You get the simple yet powerful API, we handle optimizations internally. We're always glad to see your feature requests and PRs.


Reasons to use Gramework

  • Gramework has a stable API.
  • Gramework is battle-tested.
  • Gramework is made by a maintainer of fasthttp.
  • Gramework is one of the rare frameworks that can help you use your server's resources more efficiently.
  • Gramework lowers your infrastructure costs by using as little memory as possible.
  • Gramework helps you serve requests faster, and so it helps you increase conversions (source 1, source 2).
  • With Gramework you can build software faster using a simple yet powerful and highly optimized API.
  • With Gramework you get enterprise-grade support and answers to all your questions.
  • At the Gramework team, we respect our users.
  • You can directly contact the maintainer and donate for high priority feature.
  • You can be sure that all license questions are OK with gramework.

Go >= 1.10.8 is the oldest continously tested and supported version.

Useful links and info

If you encounter any vulnerabilities then please feel free to submit them via [email protected].

Name Link/Badge
Docs GoDoc
Our Jira Jira
License Report Report
Changelog Changelog
Support us with a donation or become a sponsor OpenCollective
Our Telegram chat @gramework
Our #gramework channel in the Gophers Slack https://gophers.slack.com
Our Discord Server https://discord.gg/HkW8DsD
Master branch coverage codecov
Master branch status Build Status
Dev branch coverage codecov
Dev branch status Build Status
CII Best Practices CII Best Practices
Gramework Stats Dashboard for Grafana https://grafana.com/dashboards/3422
Support contacts Via email: [email protected]
Via Telegram community: @gramework

Table of Contents

Benchmarks

benchmark

Contributors

This project exists thanks to our awesome contributors! [Contribute].

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

3rd-party license info

  • Gramework is now powered by fasthttp and an embedded custom fasthttprouter. You will find the according licenses in /third_party_licenses/fasthttp and /third_party_licenses/fasthttprouter.
  • The 3rd autoTLS implementation, placed in nettls_*.go, is an integrated version of caddytls, because using it through a simple import isn't an option, gramework is based on fasthttp, which is incompatible with net/http. In the commit I based on, caddy is Apache-2.0 licensed. Its license placed in /third_party_licenses/caddy. @mholt allow us to copy the code in this repo.

FOSSA Status

Basic usage

Hello world

The example below will serve "hello, grameworld". Gramework will register the bind flag for you, that allows you to choose another ip/port that gramework should listen on:

package main

import (
	"github.com/gramework/gramework"
)

func main() {
	app := gramework.New()

	app.GET("/", "hello, grameworld")

	app.ListenAndServe()
}

If you don't want to support the bind flag then pass the optional address argument to ListenAndServe.

NOTE: all examples below will register the bind flag.

JSON world ;) Part 1

From version: 1.1.0-rc1

The example below will serve {"hello":"grameworld"} from the map. Gramework will register the bind flag for you, that allows you to choose another ip/port that gramework should listen on:

package main

import (
	"github.com/gramework/gramework"
)

func main() {
	app := gramework.New()

	app.GET("/", func() map[string]interface{} {
		return map[string]interface{}{
			"hello": "gramework",
		}
	})

	app.ListenAndServe()
}

JSON world. Part 2

From version: 1.1.0-rc1

The example below will serve {"hello":"grameworld"} from the struct. Gramework will register the bind flag for you, that allows you to choose another ip/port that gramework should listen on:

package main

import (
	"github.com/gramework/gramework"
)

type SomeResponse struct {
	hello string
}

func main() {
	app := gramework.New()

	app.GET("/", func() interface{} {
		return SomeResponse{
			hello: "gramework",
		}
	})

	app.ListenAndServe()
}

Serving a dir

The example below will serve static files from ./files:

package main

import (
	"github.com/gramework/gramework"
)

func main() {
	app := gramework.New()

	app.GET("/*any", app.ServeDir("./files"))

	app.ListenAndServe()
}

Serving prepared bytes

The example below will serve a byte slice:

package main

import (
	"fmt"
	"os"
	"time"

	"github.com/gramework/gramework"
)

type SomeData struct {
	Name string
	Age  uint8
}

func main() {
	app := gramework.New()

	d := SomeData{
		Name: "Grame",
		Age:  20,
	}

	// service-wide CORS. you can also instead of using middleware
	// call ctx.CORS() manually
	app.Use(app.CORSMiddleware())

	app.GET("/someJSON", func(ctx *gramework.Context) {
		// send json, no metter if user asked for json, xml or anything else.
		if err := ctx.JSON(d); err != nil {
			// you can return err instead of manual checks and Err500() call.
			// See next handler for example.
			ctx.Err500()
		}
	})

	app.GET("/simpleJSON", func(ctx *gramework.Context) error {
		return ctx.JSON(d)
	})

	app.GET("/someData", func(ctx *gramework.Context) error {
		// send data in one of supported encodings user asked for.
		// Now we support json, xml and csv. More coming soon.
		sentType, err := ctx.Encode(d)
		if err != nil {
			ctx.Logger.WithError(err).Error("could not process request")
			return err
		}
		ctx.Logger.WithField("sentType", sentType).Debug("some request-related message")
		return nil
	})

	// you can omit context if you want, return `interface{}`, `error` or both.
	app.GET("/simplestJSON", func() interface{} {
		return d
	})

	// you can also use one of built-in types as a handler, we got you covered too
	app.GET("/hostnameJSON", fmt.Sprintf(`{"hostname": %q}`, os.Hostname()))

	wait := make(chan struct{})
	go func() {
		time.Sleep(10 * time.Minute)
		app.Shutdown()
		wait <- struct{}{}
	}()

	app.ListenAndServe()

	// allow Shutdown() to stop the app properly.
	// ListenAndServe will return before Shutdown(), so we should wait.
	<-wait
}

Using dynamic handlers, example 2. Simple FastHTTP-compatible handlers.

This example demonstrates how to migrate from fasthttp to gramework without rewriting your handlers.

package main

import (
	"github.com/gramework/gramework"
	"github.com/valyala/fasthttp"
)

func main() {
	app := gramework.New()

	app.GET("/someJSON", func(ctx *fasthttp.RequestCtx) {
		ctx.WriteString("another data")
	})

	app.ListenAndServe()
}
Issues
  • *any with Index

    *any with Index

    Hi, while gramework supprts any route

    package main
    import (
    	"github.com/gramework/gramework"
    )
    func main() {
    	app := gramework.New()
    	app.GET("/*any", app.ServeDir("./files"))
    	app.ListenAndServe()
    }
    

    It missed "/" as it was giving 403 error with message "directory view denied" , So, I created :-

    package main
    
    import (
    	"github.com/gramework/gramework"
    )
    
    func main() {
    	app := gramework.New()
            app.ServeFile("/", "./files/index.html")    // As Index file
    	app.GET("/*any", app.ServeDir("./files"))
    	app.ListenAndServe()
    }
    

    But i get panic error of conflict between "/" and "/*any"

    How can i add exception bar.

    Thanks

    opened by rebootcode 13
  • bug?

    bug?

    this working

    func Test(ctx *fasthttp.RequestCtx) { ctx.SetContentType("text/html; charset=utf8") ctx.WriteString("testing") }

    it's not woring

    func Test(ctx *gramework.Context) { ctx.SetContentType("text/html; charset=utf8") ctx.WriteString("testing") }

    bug expedite 
    opened by sanqi 11
  • Activating Open Collective

    Activating Open Collective

    Hi, I'm making updates for Open Collective. Either you or a supporter signed this repo up for Open Collective. This pull request adds backers and sponsors from your Open Collective https://opencollective.com/gramework ❤️

    It adds two badges at the top to show the latest number of backers and sponsors. It also adds placeholders so that the avatar/logo of new backers/sponsors can automatically be shown without having to update your README.md. [more info]. See how it looks on this repo. You can also add a "Donate" button to your website and automatically show your backers and sponsors there with our widgets. Have a look here: https://opencollective.com/widgets

    P.S: As with any pull request, feel free to comment or suggest changes. The only thing "required" are the placeholders on the README because we believe it's important to acknowledge the people in your community that are contributing (financially or with code!).

    Thank you for your great contribution to the open source community. You are awesome! 🙌 And welcome to the open collective community! 😊

    Come chat with us in the #opensource channel on https://slack.opencollective.com - great place to ask questions and share best practices with other open source sustainers!

    opened by monkeywithacupcake 7
  • Add to Context

    Add to Context "knowledge" about Sub's

    app.GET("/world", Handler) // 1
    app.Sub("/hello").GET("/world", Handler) // 2
    app.Sub("/hello").Sub("/cruel").GET("/world", Handler) // 3
    
    func Handler(ctx *gramework.Context) {
            ctx.Logger.Debug(ctx.Subs)
            // 1) nil
            // 2) ["/hello"]
            // 3) ["/hello", "/cruel"]
    }
    
    enhancement help wanted good-for-new-contributors 
    opened by toby3d 6
  • Refactoring code

    Refactoring code

    • Moved all docs to separate folder
    • Renamed '3rd-Party Licenses' on 'third_party'
    • Moved some tests to 'test' directory
    • Merge values and types blocks
    • Renamed 'types.go' to 'models.go'
    • Some little fixes
    code-review/pending-changes 
    opened by toby3d 4
  • Simple app and nil pointer dereference

    Simple app and nil pointer dereference

    Simple app fails in ten hours after starting up with "invalid memory address or nil pointer dereference"

    Log

       • registering GET /*any
       • Starting HTTP             bind=:80
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x276c08]
    
    goroutine 5933 [running]:
    github.com/gramework/gramework.(*node).GetValue(0x442012c360, 0x4422bcc5e0, 0x1a, 0x0, 0x4422b42928, 0x4, 0x20, 0x20)
            /root/go/src/github.com/gramework/gramework/fasthttprouter_tree.go:352 +0x8c8
    github.com/gramework/gramework.(*router).Allowed(0x4420095710, 0x4422bcc5e0, 0x1a, 0x4422b42928, 0x4, 0x1a, 0x20)
            /root/go/src/github.com/gramework/gramework/fasthttprouter_router.go:277 +0x27c
    github.com/gramework/gramework.(*Router).handle(0x4420086370, 0x4422bcc5e0, 0x1a, 0x4422b42928, 0x4, 0x44200862d0, 0x0, 0x270100, 0x0)
            /root/go/src/github.com/gramework/gramework/router.go:525 +0x268
    github.com/gramework/gramework.(*Router).Handler.func1(0x44200862d0)
            /root/go/src/github.com/gramework/gramework/router.go:429 +0x160
    github.com/gramework/gramework.(*App).handler.func1(0x4420892d80)
            /root/go/src/github.com/gramework/gramework/app_handler.go:57 +0x1f4
    github.com/valyala/fasthttp.(*Server).serveConn(0x44200e6500, 0x3810c0, 0x44209f98e0, 0x101, 0x0)
            /root/go/src/github.com/valyala/fasthttp/server.go:1566 +0x4d8
    github.com/valyala/fasthttp.(*Server).(github.com/valyala/fasthttp.serveConn)-fm(0x3810c0, 0x44209f98e0, 0x1, 0x0)
            /root/go/src/github.com/valyala/fasthttp/server.go:1280 +0x30
    github.com/valyala/fasthttp.(*workerPool).workerFunc(0x442015a300, 0x4422a8cb80)
            /root/go/src/github.com/valyala/fasthttp/workerpool.go:210 +0x7c
    github.com/valyala/fasthttp.(*workerPool).getCh.func1(0x442015a300, 0x4422a8cb80, 0x2a7080, 0x4422a8cb80)
            /root/go/src/github.com/valyala/fasthttp/workerpool.go:182 +0x28
    created by github.com/valyala/fasthttp.(*workerPool).getCh
            /root/go/src/github.com/valyala/fasthttp/workerpool.go:181 +0xf8
    

    Expected Behavior

    The app outputs the hello world html example.

    Current Behavior

    It just fails in some period of time.

    Possible Solution

    No idea.

    Steps to Reproduce (for bugs)

    1. Compile
    2. Either run an executable or run a dockerized executable
    3. Wait

    Your Environment

    • Go 1.9.* & Go 1.10.*
    • Ubuntu 16.04 LTS, Linux the-sun 4.4.114-mainline-rev1 #1 SMP Thu Feb 1 16:23:12 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux
    • Standalone app or Docker 17.12.0-ce
    package main
    
    import (
            "fmt"
            "sync"
    
            g "github.com/gramework/gramework"
    )
    
    const (
            appID = "app 0.0.0"
    )
    
    func main() {
            lock := &sync.Mutex{}
            n := uint(0)
            app := g.New()
            app.GET("/*any", func(ctx *g.Context) {
                    lock.Lock()
                    n++
                    lock.Unlock()
                    txt := fmt.Sprintf("<html><head><title>Welcome</title></head><body><div style=\"text-align:center\">Welcome!</div><br /><div>Views #%v</div></body></html>", n)
                    ctx.Response.Header.Set("Server", appID)
                    ctx.HTML().WriteString(txt)
            })
            app.ListenAndServe()
    }
    
    opened by AnyCPU 4
  • [1 point] Splitted static & parametrized routers

    [1 point] Splitted static & parametrized routers

    Gramework can't set route with path argument on root:

    ...
       • registering GET /        
       • registering GET /editor  
       • registering POST /publish
       • registering GET /:id     
    panic: wildcard route ':id' conflicts with existing children in path '/:id'
    

    So, I can't use dynamic paths like /:slug or /:id-:slug in my project for serve blog-posts (eg. /1234-hello-world, /my-custom-page).

    enhancement 
    opened by toby3d 3
  • [feature] Please make method `handler()` accessible

    [feature] Please make method `handler()` accessible

    Hi. I'm currently using unix socket for testing, but my issue is that app.handler() is not accessible.

    package main
    
    import (
    	"log"
    	"net"
    	"github.com/valyala/fasthttp"
    	"github.com/gramework/gramework"
    )
    
    func main() {
    	app := gramework.New()
    	app.GET("/", "hello, grameworld")
    	listenAndServe(app)
    }
    
    func listenAndServe(app *gramework.App) {
    	ln, err := net.Listen("unix", "webd.sock")
    	if err != nil {
    		log.Fatalf("error in net.Listen: %s", err)
    	}
    	if err := fasthttp.Serve(ln, app.Handler()); err != nil {
    		log.Fatalf("error in Serve: %s", err)
    	}
    }
    

    I had to add into app_handler.go something like this:

    func (app *App) Handler() func(*fasthttp.RequestCtx) {
            return app.handler()
    }
    

    The other solution would be to refactor handler() to Handler(). Thank you.

    question 
    opened by concatime 3
  • metrics middleware broken

    metrics middleware broken

    I suspect it's bad to use gramework.BytesToString here:

    https://github.com/gramework/gramework/blob/dev/metrics/metrics.go#L95

    It causes errors like this in the /metrics endpoint:

    * collected metric "gramework_http_requests_total" { label:<name:"code" value:"200" > label:
    <name:"method" value:"POST" > label:<name:"node" value:"bb6f5bf92c76" > label:<name:"path" 
    value:"/foo/Bars" > label:<name:"service" value:"/app" > label:<name:"type" value:"http" > counter:
    <value:23 > } was collected before with the same name and label values
    

    Looks like the underlying byte array mutates under gramework's feets. Swapping to string() fixes the issue.

    Another symptom is that paths where some are longer than others, the shorter ones may get garbage at the end.

    pending-uat-feedback 
    opened by dsvensson 2
  • Wrong v1.3.1 version tag, actually v.1.3.1

    Wrong v1.3.1 version tag, actually v.1.3.1

    Expected Behavior

    Tag name shold be v1.3.1 and GO111MODULE=on go get github.com/gramework/gramework must find end retrieve 1.3.1 version

    Current Behavior

    Tag name is v.1.3.1 (v<dot>1.3.1) and

    GO111MODULE=on go get github.com/gramework/gramework
    go: finding github.com/gramework/gramework v1.3.0
    

    Possible Solution

    Add correct tag v1.3.1

    Steps to Reproduce (for bugs)

    GO111MODULE=on go get github.com/gramework/gramework

    Context

    This issue prevent me use lastest gramework version in simple natural way. And possible can break update procedure. I have to address concrete tag not version in go module workflow.

    Your Environment

    Darwin 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64
    
    GOARCH="amd64"
    GOBIN=""
    GOCACHE="/Users/valbaev/Library/Caches/go-build"
    GOEXE=""
    GOFLAGS=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOOS="darwin"
    GOPATH="/Users/valbaev/go"
    GOPROXY=""
    GORACE=""
    GOROOT="/usr/local/Cellar/go/1.11.1/libexec"
    GOTMPDIR=""
    GOTOOLDIR="/usr/local/Cellar/go/1.11.1/libexec/pkg/tool/darwin_amd64"
    GCCGO="gccgo"
    CC="clang"
    CXX="clang++"
    CGO_ENABLED="1"
    GOMOD="/Users/valbaev/Projects/my/bzzz/go.mod"
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/d6/3nqkzg590x5_xn10fr8wcyt00000gn/T/go-build634544187=/tmp/go-build -gno-record-gcc-switches -fno-common"
    
    opened by albenik 2
  • Is gramework still using caddytls or tls of golang stdlib?

    Is gramework still using caddytls or tls of golang stdlib?

    I could not find the 3rd autoTLS implementation, placed in nettls_*.go, but found crypto/tls in AutoTLS implemetation. If gramework no longer used caddytls, Why?

    question 
    opened by cih-y2k 2
  • Server resend request cookies in response with different parameters

    Server resend request cookies in response with different parameters

    Expected Behavior

    Server does not return request cookies with incorrect parameters in the response.

    Current Behavior

    Server return in response cookies from request with incorrect parameters.

    Possible Solution

    Separate request cookies from other cookies in Cookies.Storage and do not return request cookies in the response?

    Steps to Reproduce (for bugs)

    1. Set in browser some cookie with specific parameters (expires, path)
    2. Send request to the server with that cookie
    3. In response will be a Set-Cookie header with different parameters (empty parameters, or specific from server configuration)
    4. Now browser either has two identical cookies that differ in parameters, or updates the existing cookie.

    Context

    If I understand correctly, all requests are processed in App.handler(). Cookies from request are loaded into the Cookies.Storage here and when ctx.saveCookies() is called, cookies from Cookies.Storage are placed in the response headers. Server knows about cookies from the request only their name and value, so all other cookies parameters will be changed.

    This behavior can be dangerous, since server can make the authorization cookie accessible for javascript from the browser (remove the httponly and secure flags).

    I'm just starting to analyze a project that uses gramework, so I apologize if I'm wrong and this behavior is either customizable or has nothing to do with gramework at all. For the moment, we just added pre-middleware, which removes everything from Cookie.Storage, but it seems like a bad solution.

    Your Environment

    • Version used: v1.7.0-rc3
    • Environment name and version: go1.13 on Alpine or MacOS 10.14.6
    • Server type and version: Local MacOS 10.14.6 or Kubernetes
    opened by Arimeka 1
  • Getting nil value for path variables

    Getting nil value for path variables

    I would expect to get the path variable but instead I get nil after few times calling the endpoint. For example if you call this endpoint few times (maybe around 20 times) then you will get nil instead of "25". But for the first few requests it works fine.

    package main

    import ( "fmt" "github.com/gramework/gramework" )

    func Hello(ctx *gramework.Context) { ctx.Writef("Hello %s, id: %s!\n", ctx.UserValue("name"), ctx.UserValue("id")) }

    func main() { app := gramework.New() app.GET("/:id/:name", Hello) app.ListenAndServe(":8080") }

    // Call the endpoint: curl localhost:8080/25/Bob

    I noticed that for the first few time, the path values are not cached so everything is fine but for the rest of the calls, these values are coming from the cache and then id becomes nil.

    opened by kamiiiel 2
  • Make contribution rules explicitly

    Make contribution rules explicitly

    Now, gramework's contribution rules were unclear. And code style was not unified. It makes problem to contribute to this project. 😢

    Needs

    1. Explicit documentation rules
    2. Unified code style

    I think we need to discuss this proposal to make a better project.

    help wanted needs investigation 
    opened by KimMachineGun 9
  • Compile errors due to dependency problems with dep

    Compile errors due to dependency problems with dep

    I use dep for my projects, with usual dep use it cannot download right dependencies automatically. Didn't check it with go get and others managers, maybe related to them too.

    Expected Behavior

    After den ensure project should compile without any errors.

    Current Behavior

    It cannot because of updated lego and fasthttp libs.

    Possible Solution

    Edit manually Gopkg.toml by adding this:

    [[override]]
      name = "github.com/xenolf/lego"
      version = "0.5.0"
    
    [[override]]
      name = "github.com/valyala/fasthttp"
      version = "1.0.0"
    

    and try dep ensure again (you can also try to delete Gopkg.lock and vendor files before).

    Steps to Reproduce (for bugs)

    1. Use dep
    2. Download dependencies by using dep ensure command

    Context

    I wanted to get it work with dep because vgo on 1.10 is pretty unstable for production use.

    Your Environment

    • Version used: v1.2.0
    • Environment name and version (e.g. Go1.9 on CentOS 7, kernel 4.11.2): Fedora 28, Go 1.10.3, 4.18.12
    • Server type and version: net/http
    • Operating System and version: Fedora 28
    • Link to your project: none
    bug 
    opened by L11R 0
Releases(v1.7.1)
  • v1.7.1(Oct 14, 2021)

  • v1.7.0-rc3(Sep 7, 2019)

  • v1.7.0-rc2(Feb 3, 2019)

  • v1.7.0-rc1(Jan 30, 2019)

    • The Behind interface that should allow proper IP detection as soon as you provide proper unwrapper.
    • First Behind unwrapper for Akamai. NOTE: they do not provide support for that unwrapper. If you have any bugs, please contact our support or open an issue.
    • When registering route, in the handler path github.com/gramework/gramework/ replaced with #gramework for short.
    Source code(tar.gz)
    Source code(zip)
  • v1.6.2(Jan 30, 2019)

  • v1.5.4(Jan 30, 2019)

  • v1.6.1(Jan 3, 2019)

  • v1.6.0(Dec 25, 2018)

    • grypto package rewritten and will use scrypt instead of bcrypt by default, allowing you to verify both types of hashes with MCF. This change closes the bcrypt vulnerability of long passwords (>56 characters) and automatically migrates on the more secure hashing algorithm.
    • Refactoring and vendor fixes (1.5.4-rc1)
    Source code(tar.gz)
    Source code(zip)
  • v1.5.4-rc1(Dec 19, 2018)

  • v1.5.3(Dec 18, 2018)

  • v1.5.2(Dec 12, 2018)

    Gramework Environments refactored. You can find the list of supported environment names below:

    environments := map[string]Environment{
        "prod":        PROD,
        "production":  PROD,
        "stage":       STAGE,
        "staging":     STAGE,
        "dev":         DEV,
        "development": DEV,
    }
    
    Source code(tar.gz)
    Source code(zip)
  • v1.5.1(Nov 22, 2018)

  • v1.5.0(Nov 6, 2018)

    • Separate store static route. Allows both /post/:id and /post/about routes
    • Healtchecks module added
    • Fix resource usage leak in ctx.Proxy()
    • Sub() now allows to convert App's root router to a SubRouter type
    Source code(tar.gz)
    Source code(zip)
  • v1.4.2(Nov 5, 2018)

  • v1.4.1(Oct 26, 2018)

  • v1.4.0(Oct 26, 2018)

    by @albenik:

    • Added OptAppName option for App initializer
    • Fixed ability to set empty "" server name
    • Fixed fasthttp.Server name set via App.SetName()
    • Method App.SetName() market as deprecated in favor of OptAppName
    • Methods App.ListenAndServeAllDev() & App.ListenAndServeAutoTLSDev() marked as deprecated and from now is simple aliases of App.ListenAndServeAll() & App.ListenAndServeAutoTLS() accordingly
    • Fixed go.mod dependencies and go mod vendor applied to support older versions of GO
    Source code(tar.gz)
    Source code(zip)
  • v1.3.2(Oct 24, 2018)

  • v.1.3.1(Oct 19, 2018)

  • v1.3.0(Oct 14, 2018)

    Adds support for reflect handlers. Allows you to do things like

    	app.POST("/0", func(userData User, ctx *gramework.Context) (interface{}, error) {
    		return nil, errors.New("something went lol")
    	})
    
    	app.POST("/1", func(userData User, ctx *gramework.Context) (interface{}, error) {
    		return userData, nil
    	})
    
    	app.POST("/2", func(userData User, ctx *gramework.Context) interface{} {
    		return userData
    	})
    
    	app.POST("/3", func(userData User, ctx *gramework.Context) error {
    		return errors.New("hello")
    	})
    
    	app.POST("/4", func(userData *User, ctx *gramework.Context) *User {
    		return userData
    	})
    
    	app.POST("/5", func(userData *User, a int) interface{} {
    		if userData != nil {
    			return userData
    		}
    		return a
    	})
    
    
    Source code(tar.gz)
    Source code(zip)
  • v1.2.3(Oct 12, 2018)

    Gramework now serving static pre-defined JSON as a handler, see gramework.JSON for more info, or example below:

    package main
    
    import (
        "github.com/gramework/gramework"
    )
    
    func main() {
        app := gramework.New()
    
        app.GET("/some/mock", gramework.JSON(`{ "a": "b" }`)
    
        app.ListenAndServe()
    }
    
    
    Source code(tar.gz)
    Source code(zip)
  • v1.2.2(Oct 10, 2018)

  • v1.2.1(Oct 10, 2018)

  • 1.1.1(Sep 12, 2018)

    • Codestyle fixes
    • Log gramework version and system information on startup
    • Handler name: show path to file starting from GOPATH
    • Gramework now supports serving static pre-defined HTML as a handler, see gramework.HTML for more info
    Source code(tar.gz)
    Source code(zip)
Golanger Web Framework is a lightweight framework for writing web applications in Go.

/* Copyright 2013 Golanger.com. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except

golanger 299 Mar 3, 2022
Eudore is the core of a golang lightweight web framework.

Eudore eudore是一个golang轻量级web框架核心,可以轻松扩展成一个技术栈专用框架,具有完整框架设计体系。 反馈和交流请加群组:QQ群373278915。 Features 易扩展:主要设计目标、核心全部解耦,接口即为逻辑。 简单:对象语义明确,框架代码量少复杂度低,无依赖库。 易用

null 72 Jun 15, 2022
Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.

Gin Web Framework Gin is a web framework written in Go (Golang). It features a martini-like API with performance that is up to 40 times faster thanks

Gin-Gonic 60.5k Jun 27, 2022
a golang web mvc framework, like asp.net mvc.

goku goku is a Web Mvc Framework for golang, mostly like ASP.NET MVC. doc & api Installation To install goku, simply run go get github.com/QLeelulu/go

QLeelulu 275 May 24, 2022
The web framework for Golang

uAdmin the Golang Web Framework Easy to use, blazing fast and secure. Originally open source by IntegrityNet Solutions and Services For Documentation:

uADMIN 193 May 30, 2022
Mango is a modular web-application framework for Go, inspired by Rack, and PEP333.

Mango Mango is a modular web-application framework for Go, inspired by Rack and PEP333. Note: Not actively maintained. Overview Mango is most of all a

Paul Bellamy 366 Jun 3, 2022
An ideally refined web framework for Go.

Air An ideally refined web framework for Go. High-performance? Fastest? Almost all web frameworks are using these words to tell people that they are t

Aofei Sheng 414 Jun 15, 2022
Web framework for creating apps using Go in Google AppEngine

Welcome to app.go v3.0 app.go is a simple web framework for use in Google AppEngine. Just copy the app folder to your working folder and import it fro

George Nava 46 Mar 21, 2021
Goal is a toolkit for high productivity web development in Go language in the spirit of Revel Framework that is built around the concept of code generation.

Goal Goal is a set of tools for high productivity web development in Go language. Goal, being mostly inspired by Revel Framework and its discussions,

null 88 Sep 27, 2021
A high level web-framework for Go

go-start is a high level web-framework for Go, like Django for Python or Rails for Ruby. Installation: go get github.com/ungerik/go-start Documentatio

Erik Unger 264 May 31, 2022
A lightweight RESTful web framework for Go

Goweb A lightweight RESTful web framework for Go. For examples and usage, please read the Goweb API Documentation Read our Articles Who uses Goweb? "U

Stretchr, Inc. 630 May 10, 2022
Classy web framework for Go

Martini NOTE: The martini framework is no longer maintained. Martini is a powerful package for quickly writing modular web applications/services in Go

Martini 11.5k Jun 29, 2022
A Go framework for building JSON web services inspired by Dropwizard

Tiger Tonic A Go framework for building JSON web services inspired by Dropwizard. If HTML is your game, this will hurt a little. Like the Go language

Richard Crowley 1k May 29, 2022
Simple web framework for go, still quite beta at this point

WFDR Framework - Beta Release New 18/Feb/2012: Updated for go 1.0, new directory layout to take advantage of the go build tool. Background There's a m

null 23 Feb 11, 2021
Golang CTF framework and exploit development module

Golang CTF framework and exploit development module

Frank Hübner 10 May 28, 2022
A lightweight and fast http router from outer space

Alien Alien is a lightweight http router( multiplexer) for Go( Golang ), made for humans who don't like magic. Documentation docs Features fast ( see

Geofrey Ernest 123 May 27, 2022
🍐 Elegant Golang REST API Framework

An Elegant Golang Web Framework Goyave is a progressive and accessible web application framework focused on REST APIs, aimed at making backend develop

SystemGlitch 1.1k Jun 23, 2022
A lightweight MVC framework for Go(Golang)

utron utron is a lightweight MVC framework in Go (Golang) for building fast, scalable and robust database-driven web applications. Features Postgres,

Geofrey Ernest 2.2k Jun 24, 2022
A simple blog framework built with GO. Uses HTML files and a JSON dict to give you more control over your content.

Go-Blog A simple template based blog framework. Instructions Built for GO version: 1 See the Documentation or Getting Started pages in the wiki. Notes

Matt West 45 Feb 18, 2022