MCPcopy Create free account
hub / github.com/bytebase/bytebase / GetEndpoint

Method GetEndpoint

backend/api/mcp/openapi_index.go:308–323  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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).
308func (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.
326func (idx *OpenAPIIndex) GetServiceEndpoints(service string) []*EndpointInfo {

Callers 2

formatEndpointDetailMethod · 0.45
handleCallAPIMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected