Example #1
0
File: adapter.go Project: hgoo/hgoo
func (this *RouteAdapter) checkMethod(runMethod string) (router *routeMapping, verifi bool) {
	value := reflect.ValueOf(this.Route)
	reflect := reflect.Indirect(value).Type()
	if funcName := value.MethodByName(runMethod); funcName.IsValid() {
		return &routeMapping{
			reflect:   reflect,
			runMethod: runMethod,
			pattern:   this.Pattern,
		}, true
	} else {
		log.E("'%s' method doesn't exist in the router %s", nil, runMethod, reflect.Name())
		return nil, false
	}
}
Example #2
0
func Name(t reflect.Type, pkgPath, name string) reflect.Type {
	return reflect.Name(t, pkgPath, name)
}