router

package
v0.0.0-...-6b5bc6d Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

type Router struct {
	Rules []Rule
}

Router contains a set of redirections

func New

func New(rules []Rule) *Router

New initialises a new router

func (*Router) Match

func (rt *Router) Match(req *url.URL) (*url.URL, bool)

Match tries to find a matching redirection for the URL req

type Rule

type Rule struct {
	Src url.URL
	Dst url.URL
}

Jump to

Keyboard shortcuts

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