Help us shape the future of Go! Take the 2026 Go Developer Survey

gzip

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

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

Go to latest
Published: Sep 12, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

README

goji_gzip

goji framework gzip middleware

example:

package main

import (
	"fmt"
	"github.com/lidashuang/goji_gzip"
	"net/http"

	"github.com/zenazn/goji"
)

func main() {

	// use gzip handle for every request
	goji.Use(gzip.GzipHandler)

	goji.Get("/", func(w http.ResponseWriter, r *http.Request) {
		fmt.Fprint(w, "helloworld..........")
	})

	goji.Serve()
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExcludeRoute

type ExcludeRoute string

ExcludeRoute contains a route to exclude, supplied to New()

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

Middleware is created with New() and contains access to Handler function

func New

func New(excludeRoutes []ExcludeRoute) *Middleware

New returns an instance of gzip.Middleware

func (*Middleware) Handler

func (c *Middleware) Handler(h http.Handler) http.Handler

Handler gzips responses

Jump to

Keyboard shortcuts

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