mirror of
https://github.com/kataras/iris.git
synced 2025-03-13 21:36:28 +01:00
Push v8.3.4 | Read HISTORY.md
Former-commit-id: e660dd91a4aae6d58c823f89cca733f02256c819
This commit is contained in:
parent
8b3c44b0a3
commit
91bad4b82b
27
HISTORY.md
27
HISTORY.md
|
@ -18,6 +18,30 @@ Developers are not forced to upgrade if they don't really need it. Upgrade whene
|
|||
|
||||
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
|
||||
|
||||
# We, 23 August 2017 | v8.3.4
|
||||
|
||||
Give read access to the current request context's route, a feature that many of you asked a lot.
|
||||
|
||||
```go
|
||||
func(ctx context.Context) {
|
||||
_ = ctx.GetCurrentRoute().Name()
|
||||
// .Method() returns string, same as ctx.Method().
|
||||
// .Subdomain() returns string, the registered subdomain.
|
||||
// .Path() returns string, the registered path.
|
||||
// .IsOnline() returns boolean.
|
||||
}
|
||||
```
|
||||
|
||||
```go
|
||||
type MyController struct {
|
||||
mvc.Controller
|
||||
}
|
||||
|
||||
func (c *MyController) Get(){
|
||||
_ = c.Route.Name() // same as `c.Ctx.GetCurrentRoute().Name()`.
|
||||
// [...]
|
||||
}
|
||||
```
|
||||
|
||||
# We, 23 August 2017 | v8.3.3
|
||||
|
||||
|
@ -340,7 +364,7 @@ Access to the low-level `context.Context` via the `Ctx` field.
|
|||
|
||||
Get the relative request path by using the controller's name via `RelPath()`.
|
||||
|
||||
Get the relative template path directory by using the controller's name via `RelTmpl`().
|
||||
Get the relative template path directory by using the controller's name via `RelTmpl()`.
|
||||
|
||||
Flow as you used to, `Controllers` can be registered to any `Party`,
|
||||
including Subdomains, the Party's begin and done handlers work as expected.
|
||||
|
@ -353,6 +377,7 @@ Optional `EndRequest(ctx)` function to perform any finalization after any method
|
|||
Inheritance, recursively, see for example our `mvc.SessionController`, it has the `mvc.Controller` as an embedded field
|
||||
and it adds its logic to its `BeginRequest`, [here](https://github.com/kataras/iris/blob/master/mvc/session_controller.go).
|
||||
|
||||
Read access to the current route via the `Route` field.
|
||||
|
||||
**Using Iris MVC for code reuse**
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ Iris may have reached version 8, but we're not stopping there. We have many feat
|
|||
### 📑 Table of contents
|
||||
|
||||
* [Installation](#-installation)
|
||||
* [Latest changes](https://github.com/kataras/iris/blob/master/HISTORY.md#we-23-august-2017--v833)
|
||||
* [Latest changes](https://github.com/kataras/iris/blob/master/HISTORY.md#we-23-august-2017--v834)
|
||||
* [Learn](#-learn)
|
||||
* [HTTP Listening](_examples/#http-listening)
|
||||
* [Configuration](_examples/#configuration)
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
8.3.3:https://github.com/kataras/iris/blob/master/HISTORY.md#we-23-august-2017--v833
|
||||
8.3.4:https://github.com/kataras/iris/blob/master/HISTORY.md#we-23-august-2017--v834
|
|
@ -5,11 +5,19 @@ package context
|
|||
type RouteReadOnly interface {
|
||||
// Name returns the route's name.
|
||||
Name() string
|
||||
// String returns the form of METHOD, SUBDOMAIN, TMPL PATH.
|
||||
String() string
|
||||
|
||||
// Method returns the route's method.
|
||||
Method() string
|
||||
|
||||
// Subdomains returns the route's subdomain.
|
||||
Subdomain() string
|
||||
|
||||
// Path returns the route's original registered path.
|
||||
Path() string
|
||||
|
||||
// String returns the form of METHOD, SUBDOMAIN, TMPL PATH.
|
||||
String() string
|
||||
|
||||
// IsOnline returns true if the route is marked as "online" (state).
|
||||
IsOnline() bool
|
||||
|
||||
|
|
|
@ -189,6 +189,10 @@ type routeReadOnlyWrapper struct {
|
|||
*Route
|
||||
}
|
||||
|
||||
func (rd routeReadOnlyWrapper) Method() string {
|
||||
return rd.Route.Method
|
||||
}
|
||||
|
||||
func (rd routeReadOnlyWrapper) Name() string {
|
||||
return rd.Route.Name
|
||||
}
|
||||
|
|
6
doc.go
6
doc.go
|
@ -35,7 +35,7 @@ Source code and other details for the project are available at GitHub:
|
|||
|
||||
Current Version
|
||||
|
||||
8.3.3
|
||||
8.3.4
|
||||
|
||||
Installation
|
||||
|
||||
|
@ -810,7 +810,7 @@ Access to the low-level `context.Context` via the `Ctx` field.
|
|||
|
||||
Get the relative request path by using the controller's name via `RelPath()`.
|
||||
|
||||
Get the relative template path directory by using the controller's name via `RelTmpl`().
|
||||
Get the relative template path directory by using the controller's name via `RelTmpl()`.
|
||||
|
||||
Flow as you used to, `Controllers` can be registered to any `Party`,
|
||||
including Subdomains, the Party's begin and done handlers work as expected.
|
||||
|
@ -823,6 +823,8 @@ Optional `EndRequest(ctx)` function to perform any finalization after any method
|
|||
Inheritance, recursively, see for example our `mvc.SessionController`, it has the `mvc.Controller` as an embedded field
|
||||
and it adds its logic to its `BeginRequest`. Source file: https://github.com/kataras/iris/blob/master/mvc/session_controller.go.
|
||||
|
||||
Read access to the current route via the `Route` field.
|
||||
|
||||
|
||||
Using Iris MVC for code reuse
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user