Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeEchoPath ¶
NormalizeEchoPath converts Echo-style :param segments to {param}.
func NormalizeFiberPath ¶
NormalizeFiberPath converts Fiber-style :param and :param? to {param}, * to {wildcard}.
func NormalizeGorillaPath ¶
normalizeGorillaPath converts {id:[0-9]+} → {id}. NormalizeGorillaPath strips regex constraints from gorilla path parameters. e.g. "/items/{id:[0-9]+}" → "/items/{id}"
Types ¶
type ChiExtractor ¶
type ChiExtractor struct{}
ChiExtractor extracts routes from go-chi/chi router registrations.
type EchoExtractor ¶
type EchoExtractor struct{}
EchoExtractor extracts routes from Echo v4 router registrations.
type Extractor ¶
Extractor discovers HTTP route registrations from parsed Go packages. Each router framework (chi, gin) has its own implementation.
type FiberExtractor ¶
type FiberExtractor struct{}
FiberExtractor extracts routes from gofiber/fiber/v2 router registrations.
type GinExtractor ¶
type GinExtractor struct{}
GinExtractor extracts routes from gin-gonic/gin router registrations.
type GorillaExtractor ¶
type GorillaExtractor struct{}
GorillaExtractor extracts routes from gorilla/mux router registrations.
type RawRoute ¶
type RawRoute struct {
Method string // GET, POST, PUT, DELETE, PATCH
Path string // Normalized path with {param} format
HandlerExpr ast.Expr // The AST expression referencing the handler function
Middlewares []ast.Expr // Middleware expressions applied to this route
File string // Source file where this route was registered
Line int // Line number of the route registration
}
RawRoute represents a single HTTP route extracted from the AST before handler resolution and contract analysis. This is the output of the route extraction phase — router-agnostic after normalization.
type StdlibExtractor ¶
type StdlibExtractor struct{}
StdlibExtractor extracts routes from net/http ServeMux registrations. Supports Go 1.22+ enhanced patterns ("GET /path/{id}") and pre-1.22 patterns.