1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-09 21:15:56 +00:00

Give read access to the current route, a feature that many of you asked for

Former-commit-id: 39295ac1331ee08d3047c84f5c8ea152bce96781
This commit is contained in:
kataras
2017-08-23 16:46:55 +03:00
parent 8b5b6b116a
commit 8b3c44b0a3
8 changed files with 129 additions and 16 deletions

View File

@@ -34,6 +34,14 @@ type Application interface {
// It is ready to use after Build state.
ServeHTTP(w http.ResponseWriter, r *http.Request)
// GetRouteReadOnly returns the registered "read-only" route based on its name, otherwise nil.
// One note: "routeName" should be case-sensitive. Used by the context to get the current route.
// It returns an interface instead to reduce wrong usage and to keep the decoupled design between
// the context and the routes.
//
// Look core/router/APIBuilder#GetRoute for more.
GetRouteReadOnly(routeName string) RouteReadOnly
// FireErrorCode executes an error http status code handler
// based on the context's status code.
//