redirect

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPSRedirector

type HTTPSRedirector struct {
	StatusCode int
}

HTTPSRedirector redirects to https

func HTTPS

func HTTPS() *HTTPSRedirector

HTTPS creates new https redirector

func (HTTPSRedirector) ServeHandler

func (m HTTPSRedirector) ServeHandler(h http.Handler) http.Handler

ServeHandler implements middleware interface

type NonWWWRedirector

type NonWWWRedirector struct {
	StatusCode int
}

NonWWWRedirector redirects to non-www

func NonWWW

func NonWWW() *NonWWWRedirector

NonWWW creates new non www redirector

func (NonWWWRedirector) ServeHandler

func (m NonWWWRedirector) ServeHandler(h http.Handler) http.Handler

ServeHandler implements middleware interface

type Redirector

type Redirector struct {
	Target     string
	StatusCode int
}

Redirector redirects to target

func To

func To(target string, statusCode int) *Redirector

To redirects to target

func (Redirector) ServeHandler

func (m Redirector) ServeHandler(h http.Handler) http.Handler

ServeHandler implements middleware interface

type WWWRedirector

type WWWRedirector struct {
	StatusCode int
}

WWWRedirector redirects to www

func WWW

func WWW() *WWWRedirector

WWW creates new www redirector

func (WWWRedirector) ServeHandler

func (m WWWRedirector) ServeHandler(h http.Handler) http.Handler

ServeHandler implements middleware interface

Jump to

Keyboard shortcuts

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