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

Replace controller's .Register with .Handle and AddDependencies with .Register in order to be aligned with the 'hero' package, all examples and docs are updated, it's crazy how I can't stop even on Christmas

Former-commit-id: 3b42963e9806e327ee42942cf156bda6059eaf8f
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-12-27 04:15:41 +02:00
parent 8fd4dc2b4b
commit b282e7c563
25 changed files with 110 additions and 119 deletions

View File

@@ -12,7 +12,7 @@ var defaultSessionManager = sessions.New(sessions.Config{})
// direct access to the current client's session via its `Session` field.
//
// SessionController is deprecated please use the new dependency injection's methods instead,
// i.e `mvcApp.AddDependencies(sessions.New(sessions.Config{}).Start)`.
// i.e `mvcApp.Register(sessions.New(sessions.Config{}).Start)`.
// It's more controlled by you,
// also *sessions.Session type can now `Destroy` itself without the need of the manager, embrace it.
type SessionController struct {
@@ -23,7 +23,7 @@ type SessionController struct {
// BeforeActivation called, once per application lifecycle NOT request,
// every single time the dev registers a specific SessionController-based controller.
// It makes sure that its "Manager" field is filled
// even if the caller didn't provide any sessions manager via the MVC's Application's `Register` function.
// even if the caller didn't provide any sessions manager via the MVC's Application's `Handle` function.
func (s *SessionController) BeforeActivation(b BeforeActivation) {
if didntBindManually := b.Dependencies().AddOnce(defaultSessionManager); didntBindManually {
b.Router().GetReporter().Add(