217
// GetMethodMetadata gets metadata for a given API method in one of the services exported by
218
// frontend (WorkflowService, OperatorService, AdminService).
220
>
switch {
221
>
case strings.HasPrefix(fullApiName, WorkflowServicePrefix):
222
>
return workflowServiceMetadata[MethodName(fullApiName)]
223
case strings.HasPrefix(fullApiName, OperatorServicePrefix):
224
return operatorServiceMetadata[MethodName(fullApiName)]
226
>
return nexusServiceMetadata[MethodName(fullApiName)]
228
>
return MethodMetadata{Scope: ScopeCluster, Access: AccessAdmin}
230
>
return MethodMetadata{Scope: ScopeUnknown, Access: AccessUnknown}
231
}
232
}
233
234
// MethodName returns just the method name from a fully qualified name.
236
>
index := strings.LastIndex(fullApiName, "/")
237
>
if index > -1 {
239
>
}
240
return fullApiName
241
}