suitableMethods returns suitable methods of typ
(typ reflect.Type)
| 69 | |
| 70 | // suitableMethods returns suitable methods of typ |
| 71 | func (s *Service) suitableHandlerMethods(typ reflect.Type) map[string]*Handler { |
| 72 | methods := make(map[string]*Handler) |
| 73 | for m := 0; m < typ.NumMethod(); m++ { |
| 74 | method := typ.Method(m) |
| 75 | mt := method.Type |
| 76 | mn := method.Name |
| 77 | if isHandlerMethod(method) { |
| 78 | raw := false |
| 79 | if mt.In(2) == typeOfBytes { |
| 80 | raw = true |
| 81 | } |
| 82 | // rewrite handler name |
| 83 | if s.Options.nameFunc != nil { |
| 84 | mn = s.Options.nameFunc(mn) |
| 85 | } |
| 86 | methods[mn] = &Handler{Method: method, Type: mt.In(2), IsRawArg: raw} |
| 87 | } |
| 88 | } |
| 89 | return methods |
| 90 | } |
| 91 | |
| 92 | // ExtractHandler extract the set of methods from the |
| 93 | // receiver value which satisfy the following conditions: |
no test coverage detected