Skip to main content

Frameworks

Created projects can utilize several Go web frameworks to handle HTTP routing and server functionality. The chosen frameworks are:

  • Chi: Lightweight and flexible router for building Go HTTP services.
  • Echo: High-performance, extensible, minimalist Go web framework.
  • Fiber: Express-inspired web framework designed to be fast, simple, and efficient.
  • Gin: A web framework with a martini-like API, but with much better performance.
  • Gorilla/Mux: A powerful URL router and dispatcher for Golang.
  • HttpRouter: A high-performance HTTP request router that scales well.

Standard Project Structure

The project is structured with a simple layout, focusing on the cmd, internal directories, allowing high Test driven development within project:

└── (Root)/
├── cmd/
│ └── api/
│ └── main.go
├── internal/
│ ├── db/
│ │ ├── database.go
│ │ └── database_test.go
│ ├── migrations/
│ │ └── 0001_create_user_table.sql
│ ├── repository/
│ │ ├── auth.go
│ │ ├── user.go
│ │ └── post.go
│ ├── server/
│ │ ├── server.go
│ │ └── routes.go
│ ├── middlewares/
│ │ ├── logger.go
│ │ └── routeGuard.go
│ ├── handlers/
│ │ ├── auth.go
│ │ ├── auth_test.go
│ │ ├── user.go
│ │ ├── user_test.go
│ │ ├── post.go
│ │ └── post_test.go
│ └── services/
│ ├── auth.go
│ ├── auth_test.go
│ ├── user.go
│ ├── user_test.go
│ ├── post.go
│ └── post_test.go
├── go.mod
├── go.sum
├── Makefile
└── README.md