1
0
Fork 0

Migrate Sirupsen to sirupsen.

This commit is contained in:
Ludovic Fernandez 2018-01-22 12:16:03 +01:00 committed by Traefiker
parent c134dcd6fe
commit fb4ba7af2b
684 changed files with 92394 additions and 33943 deletions

View file

@ -2,25 +2,25 @@ package router
import "net/http"
//This interface captures all routing functionality required by vulcan.
//The routing functionality mainly comes from "github.com/vulcand/route",
// This interface captures all routing functionality required by vulcan.
// The routing functionality mainly comes from "github.com/vulcand/route",
type Router interface {
//Sets the not-found handler (this handler is called when no other handlers/routes in the routing library match
// Sets the not-found handler (this handler is called when no other handlers/routes in the routing library match
SetNotFound(http.Handler) error
//Gets the not-found handler that is currently in use by this router.
// Gets the not-found handler that is currently in use by this router.
GetNotFound() http.Handler
//Validates whether this is an acceptable route expression
// Validates whether this is an acceptable route expression
IsValid(string) bool
//Adds a new route->handler combination. The route is a string which provides the routing expression. http.Handler is called when this expression matches a request.
// Adds a new route->handler combination. The route is a string which provides the routing expression. http.Handler is called when this expression matches a request.
Handle(string, http.Handler) error
//Removes a route. The http.Handler associated with it, will be discarded.
// Removes a route. The http.Handler associated with it, will be discarded.
Remove(string) error
//ServiceHTTP is the http.Handler implementation that allows callers to route their calls to sub-http.Handlers based on route matches.
// ServiceHTTP is the http.Handler implementation that allows callers to route their calls to sub-http.Handlers based on route matches.
ServeHTTP(http.ResponseWriter, *http.Request)
}