/app/controller/_init.go
http://github.com/sut-go/gon · Go · 27 lines · 13 code · 5 blank · 9 comment · 0 complexity · e56195c6bf75f047684a84043e063e7f MD5 · raw file
- package controller
- import "reflect"
- import "app/controller/hello"
- import "app/controller/signup"
- var Controllers = map[string]reflect.Type{}
- // var Injectables = map[string]reflect.Value{}
- func registerController(s string, c interface{}) {
- // v := reflect.ValueOf(c)
- t := reflect.Indirect(reflect.ValueOf(c)).Type()
- Controllers[s] = t
- }
- /*
- func registerInjectable(s string, c interface{}) {
- v := reflect.ValueOf(c)
- Injectables[s] = v
- }
- */
- func init() {
- registerController("hello", new(hello.HelloController))
- registerController("signup", new(signup.SignupController))
- // registerInjectable("hello.Session", hello.Session)
- }