redirect

package
Version: v0.10.14 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: Apache-2.0 Imports: 5 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  httpserver.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 httpserver.Handler interface.

type Rule

type Rule struct {
	FromScheme   func() string
	FromPath, To string
	Code         int
	Meta         bool
	httpserver.RequestMatcher
}

Rule describes an HTTP redirect rule.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL