Skip to content

Commit

Permalink
Merge pull request #17 from colegion/new_controller_conf
Browse files Browse the repository at this point in the history
Updated definition of Init magic function
  • Loading branch information
alkchr committed Oct 16, 2015
2 parents 5863795 + 85b65ad commit 7fbad28
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 422 deletions.
200 changes: 0 additions & 200 deletions config/config.go

This file was deleted.

116 changes: 0 additions & 116 deletions config/config_test.go

This file was deleted.

8 changes: 0 additions & 8 deletions config/testdata/base.ini

This file was deleted.

5 changes: 0 additions & 5 deletions config/testdata/incorrect.ini

This file was deleted.

1 change: 0 additions & 1 deletion config/testdata/loop.ini

This file was deleted.

1 change: 0 additions & 1 deletion config/testdata/loop2.ini

This file was deleted.

8 changes: 0 additions & 8 deletions config/testdata/test.ini

This file was deleted.

10 changes: 8 additions & 2 deletions internal/skeleton/assets/handlers/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

contr "github.com/colegion/goal/internal/skeleton/controllers"

"github.com/colegion/goal/config"
"github.com/colegion/goal/strconv"
)

Expand Down Expand Up @@ -145,7 +144,14 @@ func (t tApp) PostGreet(w http.ResponseWriter, r *http.Request) {
}
}

func initApp(g config.Getter) {
// Init is used to initialize controllers of "github.com/colegion/goal/internal/skeleton/controllers"
// and its parents.
func Init() {
initApp()
initControllers()
}

func initApp() {
}

func init() {
Expand Down
16 changes: 4 additions & 12 deletions internal/skeleton/assets/handlers/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
c2 "github.com/colegion/goal/internal/skeleton/assets/handlers/github.com/colegion/contrib/controllers/sessions"
contr "github.com/colegion/goal/internal/skeleton/controllers"

"github.com/colegion/goal/config"
"github.com/colegion/goal/strconv"
)

Expand Down Expand Up @@ -104,17 +103,10 @@ func (t tControllers) Finally(c *contr.Controllers, w http.ResponseWriter, r *ht
return
}

// Init is used to initialize controllers of "github.com/colegion/goal/internal/skeleton/controllers"
// and its parents.
func Init(g config.Getter) {
initApp(g)
initControllers(g)
}

func initControllers(g config.Getter) {
c0.Init(g)
c1.Init(g)
c2.Init(g)
func initControllers() {
c0.Init()
c1.Init()
c2.Init()
}

func init() {
Expand Down
Loading

0 comments on commit 7fbad28

Please sign in to comment.