# gin-gonic/examples

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/gin-gonic-examples).**

4,537 stars · 727 forks · Go · MIT

## Links

- GitHub: https://github.com/gin-gonic/examples
- Homepage: https://gin-gonic.com/
- awesome-repositories: https://awesome-repositories.com/repository/gin-gonic-examples.md

## Topics

`gin` `gin-gonic` `go`

## Description

This repository is a collection of implementation patterns, tutorial code, and practical examples for building web applications with the Gin framework in Go. It serves as a guide for learning how to structure Go web servers, specifically focusing on mapping URL paths to handler functions and managing request flow.

The project provides demonstrations of middleware implementation for tasks such as authentication, logging, and rate limiting. It also includes reference examples for developing REST APIs, with a focus on structuring data and sending JSON responses to clients.

## Tags

### Web Development

- [Tutorials](https://awesome-repositories.com/f/web-development/api-frameworks/gin-based-frameworks/tutorials.md) — Provides instructional guides and practical code examples for learning how to use the Gin web framework.
- [Web Framework Route Handlers](https://awesome-repositories.com/f/web-development/backend-development/web-frameworks/routing-request-handling/http-request-handlers/path-based-handler-routings/web-framework-route-handlers.md) — Demonstrates how to map URL patterns to specific application functions within a web framework.
- [Request Routing](https://awesome-repositories.com/f/web-development/go-api-toolkits/request-routing.md) — Provides practical examples of mapping incoming HTTP requests to handler functions within Go services.
- [HTTP Request Routing](https://awesome-repositories.com/f/web-development/http-request-routing.md) — Maps incoming network paths and URLs to specific handlers or controllers using predefined patterns. ([source](https://gin-gonic.com/en/docs/))
- [Middleware Chains](https://awesome-repositories.com/f/web-development/middleware-chains.md) — Provides examples of architectural pipelines for processing HTTP requests and responses through a chain of handlers.
- [HTTP Middleware Pipelines](https://awesome-repositories.com/f/web-development/request-middleware-pipelines/http-middleware-pipelines.md) — Implements middleware chains that intercept and transform HTTP requests for logging and authentication.
- [JSON Response Formatters](https://awesome-repositories.com/f/web-development/response-formatting/json-response-formatters.md) — Provides utilities to convert data structures into JSON strings and set appropriate HTTP content-type headers. ([source](https://gin-gonic.com/en/docs/))
- [JSON APIs](https://awesome-repositories.com/f/web-development/json-apis.md) — Provides reference examples for building services that deliver structured JSON data for programmatic consumption.
- [RESTful API Development](https://awesome-repositories.com/f/web-development/restful-api-development.md) — Provides reference patterns for building scalable web services using standard HTTP methods and JSON.
- [Radix Tree Routers](https://awesome-repositories.com/f/web-development/routing-systems/routing/matching-algorithms/radix-tree-routers.md) — Uses high-performance compressed trie structures to match incoming URL paths to handler functions.

### Networking & Communication

- [HTTP Request Dispatching](https://awesome-repositories.com/f/networking-communication/http-request-dispatching.md) — Demonstrates mechanisms that map incoming HTTP requests to internal handler callbacks based on path patterns.

### Software Engineering & Architecture

- [Request Interception Middleware](https://awesome-repositories.com/f/software-engineering-architecture/request-interception-middleware.md) — Implements architectural patterns for intercepting requests to perform authentication, logging, and rate limiting. ([source](https://gin-gonic.com/en/docs/))
- [Framework Middleware Examples](https://awesome-repositories.com/f/software-engineering-architecture/request-interception-middleware/framework-middleware-examples.md) — Shows how to intercept HTTP requests for authentication, logging, and rate limiting specifically within Gin.
