1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00

add a dependency-injection examples folder for the next release and some improvements

Former-commit-id: 040168afb7caf808618f7da5e68ae8eb01cb7170
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-03-01 02:17:19 +02:00
parent 5fc24812bc
commit ce2eae9121
19 changed files with 214 additions and 76 deletions

View File

@@ -156,7 +156,7 @@ before begin the implementation of it.
b.Register("user_dep", func(db myDB) User{...}).DependsOn("db")
b.Handler(func(user User) error{...})
b.Handler(func(ctx iris.Context, reuseDB myDB) {...})
Why linked over automatically? Because more thna one dependency can implement the same input and
Why linked over automatically? Because more than one dependency can implement the same input and
end-user does not care about ordering the registered ones.
Link with `DependsOn` SHOULD be optional, if exists then limit the available dependencies,
`DependsOn` SHOULD accept comma-separated values, e.g. "db, otherdep" and SHOULD also work
@@ -170,6 +170,8 @@ so, in theory, end-developers could achieve same results by hand-code(inside the
26 Feb 2020. Gerasimos Maropoulos
______________________________________________
29 Feb 2020. It's done.
*/
type testMessage struct {