router

package
v0.0.0-...-63a3be0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetURLVars

func SetURLVars(r *http.Request, val map[string]string) *http.Request

SetURLVars sets the URL variables for the given request, to be accessed via router.Vars for testing route behaviour.

func Vars

func Vars(r *http.Request) map[string]string

Vars returns the route variables for the current request, if any.

Types

type Route

type Route struct {
	*mux.Route
}

Route stores information to match a request and build URLs

func CurrentRoute

func CurrentRoute(r *http.Request) *Route

CurrentRoute returns the matched route for the current request, if any

type Router

type Router struct {
	*mux.Router
}

Router registers routes to be matched and dispatches a handler

func New

func New() *Router

New returns a Router objects filled with new gorilla/mux Router

Jump to

Keyboard shortcuts

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