Skip to content
This repository has been archived by the owner on Aug 17, 2024. It is now read-only.
/ gofr-Alokit Public archive
forked from gofr-dev/gofr

An opinionated Go framework for accelerated microservice development

License

Notifications You must be signed in to change notification settings

ALOK-Yeager/gofr-Alokit

 
 

Repository files navigation

GoFr

logo


Gofr is an opinionated microservice development framework. Listed in CNCF Landscape.

Visit https://gofr.dev for more details and documentation.

🎯 Goal

Even though generic applications can be written using Gofr, our main focus is to simplify the development of microservices. We will focus ourselves towards deployment in kubernetes and aspire to provide out-of-the-box observability.

⚡️ Quick Start Guide

If you already have a go project with go module, you can get gofr by calling: go get gofr.dev. Follow the instructions below, if you are starting afresh.

The latest version of go in your system should be installed. If you have not already done that, install it from here. This can be tested by opening a terminal and trying go version. One should also be familiar with golang syntax. Official golang website has an excellent tour of go and is highly recommended.

Writing an API service using Gofr is very simple.

  1. In an empty folder, initialise your go module using: go mod init test-service. If you intend to push your code to github, it is recommended to name your module like this: go mod init github.com/{USERNAME}/{REPO}
  2. Create main.go file with following content:
package main

import "gofr.dev/pkg/gofr"

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

    app.GET("/", func(ctx *gofr.Context) (interface{}, error) {
        return "Hello World!", nil
    })

    app.Start()
}
  1. Get all the dependencies using go get ./.... It will download gofr along with every other package it requires.
  2. Start the server: go run main.go It will start the server on default port 8000. If this port is already in use, you can override the default port by mentioning an environment variable like this: HTTP_PORT=9000 go run main.go

💡 Advantages/Features

  1. Simple API syntax
  2. REST Standards by default
  3. Battle Tested at Enterprise Scale
  4. Configuration management
  5. Database state management using migrations
  6. Inbuilt Middlewares along with support for custom middlewares
  7. Error Management
  8. Inbuilt Datastore, File System, Pub/Sub
  9. gRPC support
  10. Chained timeout control
  11. Serve Static Files
  12. Websocket
  13. Support for Surge Protection
  14. Inbuilt Traces, Metrics and Logs

👍 Contribute

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

  1. Add a GitHub Star to the project.
  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.

About

An opinionated Go framework for accelerated microservice development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.9%
  • HTML 0.1%