compress

package
v0.0.0-...-4cbec95 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2017 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultGzipConfig is the default Gzip middleware config.
	DefaultGzipConfig = GzipConfig{
		Skipper: skipper.DefaultSkipper,
		Level:   -1,
	}
)

Functions

func Gzip

func Gzip() macross.Handler

Gzip returns a middleware which compresses HTTP response using gzip compression scheme.

func GzipWithConfig

func GzipWithConfig(config GzipConfig) macross.Handler

GzipWithConfig return Gzip middleware with config. See: `Gzip()`.

Types

type GzipConfig

type GzipConfig struct {
	// Skipper defines a function to skip middleware.
	Skipper skipper.Skipper

	// Gzip compression level.
	// Optional. Default value -1.
	Level int `json:"level"`
}

GzipConfig defines the config for Gzip middleware.

Jump to

Keyboard shortcuts

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