redirect

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package redirect is middleware for redirecting certain requests to other locations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redirect

type Redirect struct {
	Next  middleware.Handler
	Rules []Rule
}

Redirect is middleware to respond with HTTP redirects

func (Redirect) ServeHTTP

func (rd Redirect) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)

ServeHTTP implements the middleware.Handler interface.

type Rule

type Rule struct {
	FromScheme, FromPath, To string
	Code                     int
	Meta                     bool
}

Rule describes an HTTP redirect rule.

Jump to

Keyboard shortcuts

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