router

package
v0.0.0-...-0761370 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2014 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTPMethodGET = "GET"
)

Variables

View Source
var (
	DefaultConverter = "default"

	DefaultConverters = []string{
		"default", "[^/]+",
		"string", "[^/]+",
		"int", "\\d+",
		"path", "[^/].*",
	}
)

Functions

This section is empty.

Types

type HandlerFunc

type HandlerFunc func(http.ResponseWriter, *http.Request)

type MatchedRoute

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

type Route

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

func NewRoute

func NewRoute(pattern string, handler http.Handler, router *Router) *Route

func (*Route) GetMethods

func (r *Route) GetMethods() []string

func (*Route) GetName

func (r *Route) GetName() string

func (*Route) GetStrictSlash

func (r *Route) GetStrictSlash() bool

func (*Route) Methods

func (r *Route) Methods(v ...string) *Route

func (*Route) Name

func (r *Route) Name(name string) *Route

func (*Route) StrictSlash

func (r *Route) StrictSlash(strictSlash bool) *Route

type Router

type Router struct {
	NotFoundHandler http.Handler
	// contains filtered or unexported fields
}

func New

func New() *Router

func (*Router) Get

func (r *Router) Get(name string) *Route

func (*Router) GetRoute

func (r *Router) GetRoute(name string) *Route

func (*Router) GetStrictSlash

func (r *Router) GetStrictSlash() bool

func (*Router) Handle

func (r *Router) Handle(pattern string, handler http.Handler) *Route

func (*Router) HandleFunc

func (r *Router) HandleFunc(pattern string, f HandlerFunc) *Route

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(rw http.ResponseWriter, req *http.Request)

func (*Router) StrictSlash

func (r *Router) StrictSlash(strictSlash bool) *Router

func (*Router) UrlFor

func (r *Router) UrlFor(name string, params map[string]interface{}) (string, bool)

Jump to

Keyboard shortcuts

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