2017-08-23 15:46:55 +02:00
|
|
|
package context
|
|
|
|
|
2018-08-05 12:51:05 +02:00
|
|
|
import "github.com/kataras/iris/core/router/macro"
|
|
|
|
|
2017-08-23 15:46:55 +02:00
|
|
|
// RouteReadOnly allows decoupled access to the current route
|
|
|
|
// inside the context.
|
|
|
|
type RouteReadOnly interface {
|
|
|
|
// Name returns the route's name.
|
|
|
|
Name() string
|
2017-08-23 16:01:51 +02:00
|
|
|
|
|
|
|
// Method returns the route's method.
|
|
|
|
Method() string
|
|
|
|
|
|
|
|
// Subdomains returns the route's subdomain.
|
|
|
|
Subdomain() string
|
|
|
|
|
2017-08-23 15:46:55 +02:00
|
|
|
// Path returns the route's original registered path.
|
|
|
|
Path() string
|
|
|
|
|
2017-08-23 16:01:51 +02:00
|
|
|
// String returns the form of METHOD, SUBDOMAIN, TMPL PATH.
|
|
|
|
String() string
|
|
|
|
|
2017-08-23 15:46:55 +02:00
|
|
|
// IsOnline returns true if the route is marked as "online" (state).
|
|
|
|
IsOnline() bool
|
|
|
|
|
2017-08-24 14:40:06 +02:00
|
|
|
// StaticPath returns the static part of the original, registered route path.
|
|
|
|
// if /user/{id} it will return /user
|
|
|
|
// if /user/{id}/friend/{friendid:int} it will return /user too
|
|
|
|
// if /assets/{filepath:path} it will return /assets.
|
|
|
|
StaticPath() string
|
|
|
|
|
2017-08-23 15:46:55 +02:00
|
|
|
// ResolvePath returns the formatted path's %v replaced with the args.
|
|
|
|
ResolvePath(args ...string) string
|
2018-08-05 12:51:05 +02:00
|
|
|
|
|
|
|
// Tmpl returns the path template,
|
|
|
|
// it contains the parsed template
|
|
|
|
// for the route's path.
|
|
|
|
// May contain zero named parameters.
|
|
|
|
//
|
|
|
|
// Available after the build state, i.e a request handler or Iris Configurator.
|
|
|
|
Tmpl() macro.Template
|
|
|
|
|
|
|
|
// MainHandlerName returns the first registered handler for the route.
|
|
|
|
MainHandlerName() string
|
2017-08-23 15:46:55 +02:00
|
|
|
}
|