Skip to content

Gin Stack is a lightweight routing layer for the Gin framework that helps organize APIs with modular controllers, versioned routes, and middleware support.

License

Notifications You must be signed in to change notification settings

sant0x00/gin-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gin Stack

Gin Stack is a lightweight and structured routing layer built on top of the Gin web framework.
It helps organize your API by encouraging modular controller definitions, route grouping, versioning, and optional middleware support.

This library provides a clean abstraction for building scalable APIs while reducing boilerplate and improving maintainability.


Features

  • Clean controller-based routing interface
  • Support for grouping by API version and domain
  • Optional middleware injection per controller
  • Flexible handler binding (Bind() function) for quick routes
  • Easy to extend and integrate into existing Gin apps

Installation

go get github.com/sant0x00/gin-stack

Project Structure

.
├── router.go             # Core router logic
├── examples/             # Usage examples (modular and flat)
│   ├── modular-controllers/
│   └── flat-controller-binding/
├── go.mod
├── go.sum
├── README.md
└── LICENSE

Examples

Explore the examples/ folder to see how to use Gin Stack in different scenarios:

  • examples/modular-controllers: A recommended structure where each controller is defined in its own file, implementing the Controller interface. Ideal for large or scalable APIs.
  • examples/flat-controller-binding: A simplified approach using Bind() for directly binding handlers. Useful for prototyping, health checks, or small applications.

Contributors

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Gin Stack is a lightweight routing layer for the Gin framework that helps organize APIs with modular controllers, versioned routes, and middleware support.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors