1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00

one for today, one for tomorrow and ready :)

Former-commit-id: 2e0a335c84c1d9c57a61b7f3203e54f7cccd7dcc
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-12-30 20:40:52 +02:00
parent 75d710ce90
commit 64da28af8b
18 changed files with 320 additions and 2138 deletions

View File

@@ -32,17 +32,25 @@ func TodoApp(app *mvc.Application) {
&prefixedLogger{prefix: "DEV"},
)
// GET: http://localhost:8080/todo
// GET: http://localhost:8080/todo/custom
app.Handle(new(TodoController))
// All dependencies of the parent *mvc.Application
// are cloned to that new child, thefore it has access to the same session as well.
// are cloned to this new child,
// thefore it has access to the same session as well.
// GET: http://localhost:8080/todo/sub
app.Party("/sub").
Handle(new(TodoSubController))
}
// If controller's fields (or even its functions) expecting an interface
// but a struct value is binded then it will check if that struct value implements
// the interface and if true then it will bind it as expected.
// but a struct value is binded then it will check
// if that struct value implements
// the interface and if true then it will add this to the
// available bindings, as expected, before the server ran of course,
// remember? Iris always uses the best possible way to reduce load
// on serving web resources.
type LoggerService interface {
Log(string)