gzip

package module
v0.0.0-...-1d4cc56 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2014 License: MIT Imports: 7 Imported by: 1

README

#gzip wercker status GoDoc

Gzip middleware for Neko

Usage

package main
import (
  "github.com/rocwong/neko"
  "github.com/neko-contrib/gzip"
)

func main() {
  m := neko.New()
  m.Use(gzip.Gzip(gzip.DefaultCompression))
  m.Run(":3000")
}

Make sure to include the Gzip middleware above other middleware that alter the response body (like the render middleware).

Authors

Documentation

Index

Constants

View Source
const (
	HeaderAcceptEncoding  = "Accept-Encoding"
	HeaderContentEncoding = "Content-Encoding"
	HeaderContentLength   = "Content-Length"
	HeaderContentType     = "Content-Type"
	HeaderVary            = "Vary"

	BestCompression    = gzip.BestCompression
	BestSpeed          = gzip.BestSpeed
	DefaultCompression = gzip.DefaultCompression
	NoCompression      = gzip.NoCompression
)

Variables

This section is empty.

Functions

func Gzip

func Gzip(compressionLevel int) neko.HandlerFunc

Gzip returns a Handler that adds gzip compression to all requests

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL