compress

package module
v0.0.0-...-3eb1370 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2016 License: MIT Imports: 7 Imported by: 0

README

compress

Build Status Coverage Status

Compress middleware for Go.

Installation

go get -u github.com/go-http-utils/compress

Documentation

API documentation can be found here: https://godoc.org/github.com/go-http-utils/compress

Usage

import (
  "github.com/go-http-utils/compress"
)
mux := http.NewServeMux()
mux.HandleFunc("/", func(res http.ResponseWriter, req *http.Request) {
  res.Write([]byte("Hello World"))
})

http.ListenAndServe(":8080", compress.Handler(mux))

Documentation

Overview

Example
package main

import (
	"net/http"

	"github.com/go-http-utils/compress"
)

func main() {
	mux := http.NewServeMux()
	mux.HandleFunc("/", func(res http.ResponseWriter, req *http.Request) {
		res.Write([]byte("Hello World"))
	})

	http.ListenAndServe(":8080", compress.Handler(mux))
}
Output:

Index

Examples

Constants

View Source
const Version = "0.1.0"

Version is this package's version.

Variables

This section is empty.

Functions

func Handler

func Handler(h http.Handler) http.Handler

Handler wraps the http.Handler h with compress support.

Types

This section is empty.

Jump to

Keyboard shortcuts

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