GetEndpoint returns the endpoint info for the given operation ID. Supports both full format (bytebase.v1.SQLService.Query) and short format (SQLService/Query).
(operationID string)
| 306 | // GetEndpoint returns the endpoint info for the given operation ID. |
| 307 | // Supports both full format (bytebase.v1.SQLService.Query) and short format (SQLService/Query). |
| 308 | func (idx *OpenAPIIndex) GetEndpoint(operationID string) (*EndpointInfo, bool) { |
| 309 | // Try full format first |
| 310 | if ep, ok := idx.byOperation[operationID]; ok { |
| 311 | return ep, true |
| 312 | } |
| 313 | |
| 314 | // Try short format: Service/Method -> bytebase.v1.Service.Method |
| 315 | if parts := strings.Split(operationID, "/"); len(parts) == 2 { |
| 316 | fullID := fmt.Sprintf("bytebase.v1.%s.%s", parts[0], parts[1]) |
| 317 | if ep, ok := idx.byOperation[fullID]; ok { |
| 318 | return ep, true |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | return nil, false |
| 323 | } |
| 324 | |
| 325 | // GetServiceEndpoints returns all endpoints for the given service. |
| 326 | func (idx *OpenAPIIndex) GetServiceEndpoints(service string) []*EndpointInfo { |
no outgoing calls
no test coverage detected