Skip to content

[Go] Index GoFrame route metadata (g.Meta path: + RouterGroup.Bind) as route→method edges (follow-up to #720) #747

@colbymchenry

Description

@colbymchenry

Follow-up to #720 (suggestion #3 — structural coverage, distinct from the ranking fix).

GoFrame binds routes reflectively, so there is no literal /api/chat string and no call-graph edge from path → controller method:

// main.go
s.Group("/api", func(g *ghttp.RouterGroup) { g.Bind(chat.NewV1()) })
// api/chat/v1/chat.go — struct tag on the request type
g.Meta `path:"/chat" method:"post"`

So "where are routes registered / bound to controllers" can only be answered lexically today, and route-registration symbols have nothing to win on. Analogous to the Zustand / handler-map coverage added in #647, but for GoFrame.

Idea

Add a GoFrame framework resolver that reads:

  • the g.Meta struct tag (path: + method:) on a request type → a route node, and
  • RouterGroup.Bind(controller) / s.Group("/api", …) → a route → controller method edge (joining the request/response type to its ControllerV1 method by the GoFrame naming convention),

so route questions resolve structurally instead of lexically. Validate per the new-framework methodology in codegraph/CLAUDE.md (small/medium/large real GoFrame repos, ≥3 flow prompts each).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions