1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-09 21:15:56 +00:00

ok make it cleaner, it's working well and blazing fast but I have to do a lot cleaning and commenting and docs as well before push it to master --- hope at christmas day, also thinking some internal ideas - the whole code is not ready to be readen by a third person yet.

Former-commit-id: 0b3fb2841d5032ff47bdca42a6f4ccfeb789ce3c
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-12-19 23:40:42 +02:00
parent 4261b5784a
commit c15763c556
11 changed files with 343 additions and 313 deletions

View File

@@ -15,6 +15,7 @@ import (
// Therefore I should reduce some "freedom of change" for the shake of code maintanability in the core/router files: handler.go | router.go and single change on APIBuilder's field.
func main() {
app := iris.New()
app.Logger().SetLevel("debug")
mvc.New(app.Party("/todo")).Configure(TodoApp)
// no let's have a clear "mvc" package without any conversions and type aliases,
// it's one extra import path for a whole new world, it worths it.
@@ -74,8 +75,8 @@ func (c *TodoController) BeforeActivation(b mvc.BeforeActivation) {
}
func (c *TodoController) AfterActivation(a mvc.AfterActivation) {
if !a.IsRequestScoped() {
panic("TodoController should be request scoped, we have a 'Session' which depends on the context.")
if a.Singleton() {
panic("TodoController should be stateless, a request-scoped, we have a 'Session' which depends on the context.")
}
}