diff --git a/FAQ.md b/FAQ.md
index 7b7cc2f9..e6d242bd 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -55,4 +55,4 @@ Yes, https://chat.iris-go.com
By people like you, who help us by donating small or large amounts of money.
-Help this project deliver awesome and unique features with the highest possible code quality by donating any amount via [PayPal](https://www.paypal.me/kataras). Your name will be published [here](https://iris-go.com) after your approval via e-mail.
+Help this project deliver awesome and unique features with the highest possible code quality by donating any amount via [PayPal](https://iris-go.com/donate). Your name will be published [here](https://iris-go.com) after your approval via e-mail.
diff --git a/README.md b/README.md
index fea42d32..bab1d421 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@
# Iris Web Framework
-[](https://travis-ci.org/kataras/iris) [](https://github.com/kataras/iris/tree/master/_examples) [](https://gitter.im/iris_go/community) [](https://www.paypal.me/kataras)
+[](https://travis-ci.org/kataras/iris) [](https://github.com/kataras/iris/tree/master/_examples) [](https://gitter.im/iris_go/community) [](https://iris-go.com/donate)
@@ -32,8 +32,8 @@ Learn what [others saying about Iris](https://iris-go.com/testimonials/) and **[
```sh
# https://github.com/kataras/iris/wiki/Installation
$ go get github.com/kataras/iris/v12@master
-# assume the following code in example.go file
-$ cat example.go
+# assume the following code in main.go file
+$ cat main.go
```
```go
@@ -42,27 +42,24 @@ package main
import "github.com/kataras/iris/v12"
func main() {
- app := iris.New()
- app.Get("/ping", func(ctx iris.Context) {
- ctx.JSON(iris.Map{
- "message": "pong",
- })
- })
+ app := iris.New()
+ app.Get("/", index)
+ app.Listen(":8080")
+}
- app.Listen(":8080")
+func index(ctx iris.Context) {
+ ctx.HTML("
diff --git a/README_GR.md b/README_GR.md
index d7f5690c..b7d98ff6 100644
--- a/README_GR.md
+++ b/README_GR.md
@@ -1,6 +1,6 @@
# Iris Web Framework
-[](https://travis-ci.org/kataras/iris) [](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield) [](https://github.com/kataras/iris/tree/master/_examples) [](https://gitter.im/iris_go/community)
+[](https://travis-ci.org/kataras/iris) [](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield) [](https://github.com/kataras/iris/tree/master/_examples) [](https://gitter.im/iris_go/community)
Το Iris είναι ένα γρήγορο, απλό αλλά και πλήρως λειτουργικό και πολύ αποδοτικό web framework για τη Go γλώσσα προγραμματισμού. Παρέχει ένα εκφραστικό και εύχρηστο υπόβαθρο για την επόμενη ιστοσελίδα σας.
diff --git a/README_KO.md b/README_KO.md
index ba18083e..97bd485b 100644
--- a/README_KO.md
+++ b/README_KO.md
@@ -1,6 +1,6 @@
# Iris Web Framework
-[](https://travis-ci.org/kataras/iris) [](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield) [](https://github.com/kataras/iris/tree/master/_examples) [](https://gitter.im/iris_go/community)
+[](https://travis-ci.org/kataras/iris) [](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield) [](https://github.com/kataras/iris/tree/master/_examples) [](https://gitter.im/iris_go/community)
Iris는 단순하고 빠르며 좋은 성능과 모든 기능을 갖춘 Go언어용 웹 프레임워크입니다. 당신의 웹사이트나 API를 위해서 아름답고 사용하기 쉬운 기반을 제공합니다.
diff --git a/README_RU.md b/README_RU.md
index 4856ac3b..412456fb 100644
--- a/README_RU.md
+++ b/README_RU.md
@@ -1,6 +1,6 @@
# Iris Web Framework
-[](https://travis-ci.org/kataras/iris) [](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield) [](https://github.com/kataras/iris/tree/master/_examples) [](https://gitter.im/iris_go/community)
+[](https://travis-ci.org/kataras/iris) [](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield) [](https://github.com/kataras/iris/tree/master/_examples) [](https://gitter.im/iris_go/community)
Iris — это быстрый, простой, но полнофункциональный и эффективный веб-фреймворк для Go. Он обеспечивает красивую, выразительную и простую в использовании основу для вашего следующего веб-сайта или API.
Узнайте, что [говорят другие люди об Iris](https://iris-go.com/testimonials/) и поставьте **[звёздочку](https://github.com/kataras/iris/stargazers)** этому проекту с открытым исходным кодом, чтобы поддержать его потенциал.
diff --git a/README_ZH.md b/README_ZH.md
index 56cda87c..af329ae8 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -1,6 +1,6 @@
# Iris Web Framework
-[](https://travis-ci.org/kataras/iris) [](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield) [](https://github.com/kataras/iris/tree/master/_examples) [](https://gitter.im/iris_go/community)
+[](https://travis-ci.org/kataras/iris) [](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield) [](https://github.com/kataras/iris/tree/master/_examples) [](https://gitter.im/iris_go/community)
Iris 是基于 Go 编写的一个快速,简单但功能齐全且非常高效的 Web 框架。 它为您的下一个网站或 API 提供了一个非常富有表现力且易于使用的基础。
diff --git a/_examples/dependency-injection/context-register-dependency/main.go b/_examples/dependency-injection/context-register-dependency/main.go
new file mode 100644
index 00000000..8d73bbae
--- /dev/null
+++ b/_examples/dependency-injection/context-register-dependency/main.go
@@ -0,0 +1,95 @@
+package main
+
+import "github.com/kataras/iris/v12"
+
+func main() {
+ app := iris.New()
+ app.Use(RoleMiddleware)
+
+ app.Get("/", commonHandler)
+ c := app.ConfigureContainer()
+ /*
+ When you do NOT have access to the middleware code itself
+ then you can register a request dependency
+ which retrieves the value from the Context
+ and returns it, so handler/function's input arguments
+ with that `Role` type can be binded.
+
+ c.RegisterDependency(func(ctx iris.Context) Role {
+ role, ok := GetRole(ctx)
+ if !ok {
+ // This codeblock will never be executed here
+ // but you can stop executing a handler which depends on
+ // that dependency with `ctx.StopExecution/ctx.StopWithXXX` methods
+ // or by returning a second output argument of `error` type.
+ ctx.StopExecution()
+ return Role{}
+ }
+
+ return role
+ })
+ */
+ c.Get("/dep", handlerWithDependencies)
+
+ // http://localhost:8080?name=kataras
+ // http://localhost:8080/dep?name=kataras
+ app.Listen(":8080")
+}
+
+func commonHandler(ctx iris.Context) {
+ role, _ := GetRole(ctx)
+ ctx.WriteString(role.Name)
+}
+
+func handlerWithDependencies(role Role) string {
+ return role.Name
+}
+
+// Code for an example middleware.
+
+// Role struct value example.
+type Role struct {
+ Name string
+}
+
+const roleContextKey = "myapp.role"
+
+// RoleMiddleware example of a custom middleware.
+func RoleMiddleware(ctx iris.Context) {
+ // [do it yourself: extract the role from the request...]
+ if ctx.URLParam("name") != "kataras" {
+ ctx.StopWithStatus(iris.StatusUnauthorized)
+ return
+ }
+ //
+
+ role := Role{Name: "admin"}
+
+ ctx.Values().Set(roleContextKey, role)
+
+ // When you have access to the middleware itself:
+ // Use the `RegisterDependency` to register
+ // struct type values as dependencies at request-time for
+ // any potential dependency injection-ed user handler.
+ // This way the user of your middleware can get rid of
+ // manually register a dependency for that `Role` type with calls of
+ // `APIContainer.RegisterDependency` (and `mvc.Application.Register`).
+ ctx.RegisterDependency(role)
+
+ ctx.Next()
+}
+
+// GetRole returns the role inside the context values,
+// the `roleMiddleware` should be executed first.
+func GetRole(ctx iris.Context) (Role, bool) {
+ v := ctx.Values().Get(roleContextKey)
+ if v != nil {
+ if role, ok := v.(Role); ok {
+ return role, true
+ }
+ }
+
+ return Role{}, false
+}
+
+// End Code of our example middleware.
diff --git a/_examples/mvc/overview/README.md b/_examples/mvc/overview/README.md
index 7c6cf79d..e58e6ff7 100644
--- a/_examples/mvc/overview/README.md
+++ b/_examples/mvc/overview/README.md
@@ -92,9 +92,7 @@ Create a `database/database.go` file and copy-paste the following:
```go
package database
-import (
- "app/environment"
-)
+import "app/environment"
type DB interface {
Exec(q string) error
@@ -260,7 +258,7 @@ func (c *GreetController) Get(req model.Request) (model.Response, error) {
}
```
-The `GreetController` depends on the `GreetService`. It serves the `GET: /greet` index path through its `Get` method. The `Get` method expecting a `model.Request` which contains a single field name of `Name` which will be extracted from the `URL Query Parameter 'name'` (because it's a `GET` requst and its `url:"name"` struct field).
+The `GreetController` depends on the `GreetService`. It serves the `GET: /greet` index path through its `Get` method. The `Get` method accepts a `model.Request` which contains a single field name of `Name` which will be extracted from the `URL Query Parameter 'name'` (because it's a `GET` requst and its `url:"name"` struct field).
## Wrap up
@@ -364,14 +362,17 @@ Install [Go](https://golang.org/dl) and run the application with:
go run main.go
```
-### Docker
+