MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / methodDescriptor

Function methodDescriptor

internal/grpcsrv/interceptors/auth.go:105–119  ·  view source on GitHub ↗
(fullMethod string)

Source from the content-addressed store, hash-verified

103}
104
105func 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
121func lookupMethodDescriptor(fullMethod string) (protoreflect.MethodDescriptor, bool) {
122 parts := strings.Split(strings.TrimPrefix(fullMethod, "/"), "/")

Callers 1

AuthFunction · 0.85

Calls 1

lookupMethodDescriptorFunction · 0.85

Tested by

no test coverage detected