An opinionated GoLang framework for accelerated microservice development. Built in support for databases and observability.
APACHE-2.0 License
Listed in CNCF Landscape.
Even though generic applications can be written using GoFr, our main focus is to simplify the development of microservices. We will focus on deployment in Kubernetes and aspire to provide out-of-the-box observability.
GoFr requires Go version 1.21 or above.
With Go's module support, go [build|run|test]
automatically fetches the necessary dependencies when you add the import in your code:
import "gofr.dev/pkg/gofr"
Alternatively, use go get
:
go get -u gofr.dev/pkg/gofr
A basic example:
package main
import "gofr.dev/pkg/gofr"
func main() {
app := gofr.New()
app.GET("/greet", func(ctx *gofr.Context) (interface{}, error) {
return "Hello World!", nil
})
app.Run() // listen and serve on localhost:8000
}
To run the code, use the go run
command, like:
$ go run main.go
Then visit localhost:8000/greet
in your browser to see the response!
A number of ready-to-run examples demonstrating various use cases of GoFr are available in the GoFr examples directory.
See the godocs.
The documentation is also available on gofr.dev.
If you want to say thank you and/or support the active development of GoFr:
If your PR is merged or you have written an article or contributed in someway to development or spreading the word about GoFr, fill the Google Form, and we will send you a GoFr T-Shirt and Stickers as a token of appreciation.