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 ¶
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.
Click to show internal directories.
Click to hide internal directories.