MCPcopy Create free account
hub / github.com/astercloud/aster / RegisterRoutes

Method RegisterRoutes

pkg/a2a/handler.go:302–318  ·  view source on GitHub ↗

RegisterRoutes 注册 A2A 路由到 Gin RouterGroup

(rg *gin.RouterGroup)

Source from the content-addressed store, hash-verified

300
301// RegisterRoutes 注册 A2A 路由到 Gin RouterGroup
302func (h *Handler) RegisterRoutes(rg *gin.RouterGroup) {
303 // Agent Card 端点 (符合 A2A 规范的路径)
304 rg.GET("/.well-known/:agentId/agent-card.json", h.GetAgentCard)
305
306 // A2A JSON-RPC 端点
307 a2a := rg.Group("/a2a")
308 {
309 // 单个 JSON-RPC 请求
310 a2a.POST("/:agentId", h.HandleJSONRPC)
311
312 // 批量 JSON-RPC 请求
313 a2a.POST("/:agentId/batch", h.HandleBatchJSONRPC)
314
315 // 便捷端点:直接获取任务状态
316 a2a.GET("/:agentId/tasks/:taskId", h.GetTaskStatus)
317 }
318}

Callers 1

registerA2ARoutesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected