GoFr

一个用于加速微服务开发的有主见的 GoLang 框架。内置对数据库和可观察性的支持。「An opinionated GoLang framework for accelerated microservice development. Built in support for databases and observability.」

Github星跟蹤圖

Listed in CNCF Landscape.

🎯 Goal

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.

💡 Key Features

  1. Simple API syntax
  2. REST Standards by default
  3. Configuration management
  4. Observability (Logs, Traces, Metrics)
  5. Inbuilt Auth Middleware & Support for Custom Middleware
  6. gRPC support
  7. HTTP service with support for Circuit Breaker
  8. Pub/Sub
  9. Health Check by default for all datasources.
  10. Database Migration
  11. Cron Jobs
  12. Support for changing Log Level without restarting the application.
  13. Swagger Rendering
  14. Abstracted File Systems
  15. Websockets

banner.gif

Getting started

Prerequisites

GoFr requires Go version 1.21 or above.

Getting GoFr

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

Running 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!

See more examples

A number of ready-to-run examples demonstrating various use cases of GoFr are available in the GoFr examples directory.

👩‍💻Documentation

See the godocs.

The documentation is also available on gofr.dev.

👍 Contribute

If you want to say thank you and/or support the active development of GoFr:

  1. Star the repo.
  2. Write a review or tutorial on Medium, Dev.to or personal blog.
  3. Visit CONTRIBUTING for details on submitting patches and the contribution workflow.

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.

主要指標

概覽
名稱與所有者gofr-dev/gofr
主編程語言Go
編程語言 (語言數: 4)
平台
許可證Apache License 2.0
所有者活动
創建於2023-10-24 10:14:48
推送於2025-04-24 15:46:48
最后一次提交
發布數101
最新版本名稱v1.38.0 (發布於 2025-04-24 21:10:36)
第一版名稱v0.0.1 (發布於 )
用户参与
星數9.5k
關注者數30
派生數1.7k
提交數2k
已啟用問題?
問題數419
打開的問題數49
拉請求數954
打開的拉請求數5
關閉的拉請求數265
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?