Exemplo n.º 1
0
func newConfig() *ConfigStruct {
	config := &ConfigStruct{}
	e := reflect.ValueOf(config).Elem()
	for kind, path := range Configs {
		v := reflect.ValueOf(createConfigObject(kind, path))
		e.FieldByName(utils.Capitalize(kind)).Set(v)
	}

	return config
}
Exemplo n.º 2
0
func (s *Controller) getTargetController(name, action string) reflect.Value {
	c := controllers.GetContrllers()[name]

	return reflect.ValueOf(c).MethodByName(utils.Capitalize(action))
}