endpoints

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package endpoints implements the heuristic repomap commands: endpoint and upstreams. Route detection is pluggable via the RouteDetector interface, with built-in detectors for net/http, chi, gin, echo and gorilla/mux.

These commands pattern-match framework idioms, so every result carries a confidence field and a file:line anchor; they never present a guess as fact.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Trace

func Trace(ctx context.Context, l *loader.Loader, method, path string) (models.Endpoint, error)

Trace resolves a route to its handler and, from the handler body, its orchestration chain and upstream calls.

func UpstreamCalls

func UpstreamCalls(ctx context.Context, l *loader.Loader, path string) (models.Upstreams, error)

UpstreamCalls maps outbound calls originating under a package path.

Types

type Route

type Route struct {
	Method     string
	Path       string
	Handler    ast.Expr
	Framework  string
	Confidence string
	Pos        token.Pos
}

Route is a detected route registration.

type RouteDetector

type RouteDetector interface {
	// Name is the framework identifier (e.g. "chi").
	Name() string
	// Detect returns routes found in a single file. info may be nil if type
	// information is unavailable, in which case detectors fall back to syntax.
	Detect(file *ast.File, info *types.Info) []Route
}

RouteDetector recognizes route registrations for a particular framework.

func Detectors

func Detectors() []RouteDetector

Detectors returns the built-in detectors in a stable order.

Jump to

Keyboard shortcuts

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