1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-08 20:41:57 +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

18
context/route.go Normal file
View File

@@ -0,0 +1,18 @@
package context
// RouteReadOnly allows decoupled access to the current route
// inside the context.
type RouteReadOnly interface {
// Name returns the route's name.
Name() string
// String returns the form of METHOD, SUBDOMAIN, TMPL PATH.
String() string
// Path returns the route's original registered path.
Path() string
// IsOnline returns true if the route is marked as "online" (state).
IsOnline() bool
// ResolvePath returns the formatted path's %v replaced with the args.
ResolvePath(args ...string) string
}