https://github.com/lusingander/routegraph
https://github.com/lusingander/routegraph
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lusingander/routegraph
- Owner: lusingander
- Created: 2026-05-09T00:59:04.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2026-05-09T04:33:50.000Z (2 months ago)
- Last Synced: 2026-05-09T06:34:52.359Z (2 months ago)
- Language: Go
- Homepage:
- Size: 63.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# routegraph
routegraph is a static analyzer for Go web router definitions.
It currently focuses on [Echo](https://echo.labstack.com/) and extracts route
registrations such as `Group`, `GET`, `POST`, `Any`, and `Add` into a flat
endpoint list. Nested groups, simple string constants, limited function splits,
struct fields, chained group calls, and simple route tables are supported.
## Install
```sh
go install github.com/lusingander/routegraph/cmd/routegraph@latest
```
## CLI
Run `routegraph` with a target directory or package pattern:
```sh
routegraph ./...
routegraph ./internal/server
```
Example output:
```text
GET /api/v1/users listUsers internal/routes/user.go:24
POST /api/v1/users createUser internal/routes/user.go:25
GET /api/v1/admin/stats stats internal/routes/admin.go:18
```
Use `--format json` for machine-readable output:
```sh
routegraph --format json ./...
```
Unknown dynamic paths are kept instead of being dropped:
```text
GET /users listUsers internal/routes/user.go:31
```
## Library
routegraph can also be used as a Go library via `routegraph.Analyze`.
The library API is intentionally small for now.
## Development
This project is implemented with the help of Codex.