boundaries

package
v3.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDepth = 3

DefaultDepth is the default call graph traversal depth.

Variables

This section is empty.

Functions

func ModelToTable

func ModelToTable(model string) string

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

func TableFromSQL(sql string) string

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.

func (*Tracer) WithDepth

func (t *Tracer) WithDepth(d int) *Tracer

WithDepth returns a new Tracer with the call graph depth set to d.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL