pathroute

package
v0.0.0-...-a5469ec Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Route the request by path

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByPattern

type ByPattern []locPair

func (ByPattern) Len

func (a ByPattern) Len() int

func (ByPattern) Less

func (a ByPattern) Less(i, j int) bool

func (ByPattern) Swap

func (a ByPattern) Swap(i, j int)

type PathRouter

type PathRouter struct {
	// contains filtered or unexported fields
}

Matches the location by path regular expression. Out of two paths will select the one with the longer regular expression

func NewPathRouter

func NewPathRouter() *PathRouter

func (*PathRouter) AddLocation

func (m *PathRouter) AddLocation(pattern string, location Location) error

func (*PathRouter) GetLocationById

func (m *PathRouter) GetLocationById(id string) Location

func (*PathRouter) GetLocationByPattern

func (m *PathRouter) GetLocationByPattern(pattern string) Location

func (*PathRouter) RemoveLocation

func (m *PathRouter) RemoveLocation(location Location) error

func (*PathRouter) Route

func (m *PathRouter) Route(req Request) (Location, error)

Jump to

Keyboard shortcuts

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