redirect

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 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
y or Y : Canonical URL