Keine Beschreibung

Bo-Yi Wu 93bb0f0ed1 add 1.8.x and remove 1.5.x version. vor 8 Jahren
example 6743ec8467 revert to github.com vor 8 Jahren
.travis.yml 93bb0f0ed1 add 1.8.x and remove 1.5.x version. vor 8 Jahren
LICENSE 79783a9272 add MIT license (#10) vor 8 Jahren
README.md 6743ec8467 revert to github.com vor 8 Jahren
gzip.go 6743ec8467 revert to github.com vor 8 Jahren
gzip_test.go 6743ec8467 revert to github.com vor 8 Jahren

README.md

GZIP gin's middleware

Build Status codecov Go Report Card GoDoc

Gin middleware to enable GZIP support.

Usage

Start using it

Download and install it:

$ go get github.com/gin-contrib/gzip

Import it in your code:

import "github.com/gin-contrib/gzip"

Canonical example:

package main

import (
	"fmt"
	"time"

	"github.com/gin-contrib/gzip"
	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.Default()
	r.Use(gzip.Gzip(gzip.DefaultCompression))
	r.GET("/ping", func(c *gin.Context) {
		c.String(200, "pong "+fmt.Sprint(time.Now().Unix()))
	})

	// Listen and Server in 0.0.0.0:8080
	r.Run(":8080")
}