refactor(10.2-01): nest framework packages under modules

- Move remaining beach packages and embedded admin assets\n- Rewrite framework, example, build, and gate paths
This commit is contained in:
Jakub Zych
2026-09-28 02:21:02 +02:00
parent ac1f6d14f4
commit 5e50b166ef
277 changed files with 303 additions and 303 deletions

View File

@@ -0,0 +1,30 @@
package surf
// RouteInfo is a read-only snapshot of one registered route after Assemble
// or BuildRouter.
type RouteInfo struct {
Method string
Pattern string
PluginID string
Middleware []string
Raw bool
}
// Routes returns a defensive copy of every registered route.
func (r *Router) Routes() []RouteInfo {
if r == nil {
return nil
}
out := make([]RouteInfo, len(r.routes))
for i, rt := range r.routes {
mw := append([]string{}, rt.middleware...)
out[i] = RouteInfo{
Method: rt.method,
Pattern: rt.path,
PluginID: rt.pluginID,
Middleware: mw,
Raw: rt.raw,
}
}
return out
}