(fullMethod string)
| 103 | } |
| 104 | |
| 105 | func methodDescriptor(fullMethod string) (protoreflect.MethodDescriptor, bool) { |
| 106 | if cached, ok := methodDescCache.Load(fullMethod); ok { |
| 107 | if cached == nil { |
| 108 | return nil, false |
| 109 | } |
| 110 | return cached.(protoreflect.MethodDescriptor), true |
| 111 | } |
| 112 | desc, ok := lookupMethodDescriptor(fullMethod) |
| 113 | if ok { |
| 114 | methodDescCache.Store(fullMethod, desc) |
| 115 | } else { |
| 116 | methodDescCache.Store(fullMethod, nil) |
| 117 | } |
| 118 | return desc, ok |
| 119 | } |
| 120 | |
| 121 | func lookupMethodDescriptor(fullMethod string) (protoreflect.MethodDescriptor, bool) { |
| 122 | parts := strings.Split(strings.TrimPrefix(fullMethod, "/"), "/") |
no test coverage detected