Documentation
¶
Index ¶
Constants ¶
const DefaultDepth = 3
DefaultDepth is the default call graph traversal depth.
Variables ¶
This section is empty.
Functions ¶
func ModelToTable ¶
ModelToTable converts an ActiveRecord model class name to its conventional table name. Applies Rails naming conventions: strip namespace, CamelCase → snake_case, then pluralize. "User" → "users", "BlogPost" → "blog_posts", "MyApp::OrderItem" → "order_items"
func TableFromSQL ¶
TableFromSQL extracts the primary table name from a SQL string. Returns empty string when no table name can be statically determined. "SELECT * FROM users WHERE id = $1" → "users" "INSERT INTO orders (col) VALUES ($1)" → "orders"
Types ¶
type Hit ¶
type Hit struct {
Protocol string // postgresql, mysql, redis, http, kafka, rabbitmq
Direction string // read, write, both
Target string // table name, URL, key, or topic — empty when unresolved
Dynamic bool // true when the call site could not be statically resolved
}
Hit is a single protocol boundary interaction detected during call graph tracing.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer traces protocol boundary hits for a set of routes in a project directory.
func New ¶
func New(desc *framework.Description) (*Tracer, error)
New returns a Tracer for the given framework description.
func (*Tracer) Trace ¶
func (t *Tracer) Trace(ctx context.Context, dir string, rs []routes.Route) (map[string][]Hit, error)
Trace scans dir for handler implementations referenced by rs and returns a map of HandlerRef → []Hit. Routes with an empty HandlerRef are skipped. Handlers referenced by more than one route are traced once and results are shared.