Gin adapter for standard net/http middleware

midgin

An adapter to use standard net/http middleware in Gin.

Overview

Gin is a very capable web framework, but it does not directly support standard net/http middleware. The midgin adapter makes it possible. This type of middleware has the following signature:

func(next http.Handler) http.Handler

Usage

import (
  "github.com/gin-gonic/gin"
  "github.com/mwblythe/midgin"
  "github.com/rs/cors"
)

// use standard CORS middleware, for example
r := gin.Default()
r.Use(midgin.Adapt(cors.Default().Handler)

Similar Resources

A zerolog Logger/Recoverer middleware for chi.

A zerolog Logger/Recoverer middleware for chi.

zchi A zerolog Logger/Recoverer middleware for chi. Install go get -u github.com/Lavalier/zchi Usage package main import ( "net/http" "github.com/

Jan 19, 2022

This is a toolKit/template project for web application/server with Gin, packed common services.

gin-toolKit This is a toolKit/template project for web application/server with Gin, packed common services. These services include fasthttp, xrate, lo

May 26, 2022

Go starter project with Gin, Viper, postgres , redis, zap, prometheus metrics etc setup

Go REST Service Starter/Boilerplate Easily extendible REST API Service boilerplate aiming to follow idiomatic go and best practice. Any feedback and p

Jun 23, 2022

Package httpretty prints the HTTP requests you make with Go pretty on your terminal.

httpretty Package httpretty prints the HTTP requests of your Go programs pretty on your terminal screen. It is mostly inspired in curl's --verbose mod

Jan 8, 2023

🌿 Automated HTTP (microservices) supervisor

Epazote 🌿 Automated HTTP (microservices) supervisor Epazote automatically update/add services specified in a file call epazote.yml. Periodically chec

Nov 9, 2022

TeaWeb-可视化的Web代理服务。DEMO: http://teaos.cn:7777

 TeaWeb-可视化的Web代理服务。DEMO: http://teaos.cn:7777

TeaWeb - 可视化的Web代理服务 TeaWeb是一款集静态资源、缓存、代理、统计、日志、安全、监控于一体的可视化智能WebServer。目标是 做一个能让程序员和运维工程师喝着茶、唱着歌,就能把事情完成的一个智能化的简单易用的产品。 TeaWeb使用Go语言实现,在高可定制化前提下,保证高性

Dec 25, 2022

HTTP request logger for Golang

HTTP request logger for Golang

Horus 𓂀 Introduction Horus is a request logger and viewer for Go. It allows developers log and view http requests made to their web application. Inst

Dec 27, 2022

A simple http service that generates *.PDF reports from Grafana dashboards.

A simple http service that generates *.PDF reports from Grafana dashboards.

Grafana reporter A simple http service that generates *.PDF reports from Grafana dashboards. Requirements Runtime requirements pdflatex installed and

Dec 27, 2022

Package for easy logging to logstash http input from microservices

Micro Logger package for easy logging to logstash http input from microservices

Dec 28, 2021
Log-server - Implement log server for gwaylib/log/adapter/rmsq

Implement server of github.com/gwaylib/log Base on https://github.com/gwaycc/lserver Build . env.sh cd cmd/web go build Deploy Install supd(Debian sy

Jan 3, 2022
Mango-coral - Coral adapter for mango

mango-coral coral adapter for mango. Example import ( "fmt" mcoral "github.co

Jul 28, 2022
Go-zla - Zerolog adapter to go-facades logger interface

GO-ZLA GO ZeroLog Adapter (a.k.a. go-zla) is a lightweight Golang module that ad

Feb 16, 2022
gin-gonic/gin metrics for prometheus.
gin-gonic/gin  metrics for prometheus.

gin-metrics gin-gonic/gin metrics exporter for Prometheus. 中文 Introduction gin-metrics defines some metrics for gin http-server. There have easy way t

Jan 1, 2023
xlog is a logger for net/context aware HTTP applications
xlog is a logger for net/context aware HTTP applications

⚠️ Check zerolog, the successor of xlog. HTTP Handler Logger xlog is a logger for net/context aware HTTP applications. Unlike most loggers, xlog will

Sep 26, 2022
An golang log lib, supports tracking and level, wrap by standard log lib

Logex An golang log lib, supports tracing and level, wrap by standard log lib How To Get shell go get gopkg.in/logex.v1 source code import "gopkg.in/

Nov 27, 2022
This package enables json output, level logging and so on to standard go logger.

logplug This package enables json output, level logging and so on to standard logger. Usage log.SetOutput(logplug.NewJSONPlug(os.Stderr, logplug.LogF

Dec 27, 2021
Go-metalog - Standard API for structured logging

Metalog is a standard API for structured logging and adapters for its implementa

Jan 20, 2022
Monitor pipe progress via output to standard error.

Pipe Monitor Monitor pipe progress via output to standard error. Similar to functionality provided by the Pipe Viewer (pv) command, except this comman

Nov 14, 2022
a lightweight, high-performance, out-of-the-box logging library that relies solely on the Go standard library

English | 中文 olog olog is a lightweight, high-performance, out-of-the-box logging library that relies solely on the Go standard library. Support outpu

Apr 12, 2023