mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-30 16:26:36 +08:00
4bdfa50b0c
- Update root AGENTS.md to commit 21008cc / tag 2.1.5-rc15
- Add CI workflows info (ci-build.yml, docker-build.yml, deploy-docs.yml)
- Add Repository Layer and Contract Tests to WHERE TO LOOK
- Add websocket_reporter to CODE MAP
- Add Go version conventions (1.24/1.23/1.22)
- Add PostgreSQL migration support note
- Update go-backend AGENTS.md with PostgreSQL support and contract tests
- Update go-gost AGENTS.md with CI build conventions
- Update vite-frontend AGENTS.md with component counts
- Update go-gost/x AGENTS.md with file counts and registry reference
- Update handler AGENTS.md with LOC estimates
45 lines
2.2 KiB
Markdown
45 lines
2.2 KiB
Markdown
# GO-GOST/X KNOWLEDGE BASE
|
|
|
|
## OVERVIEW
|
|
Local fork of `github.com/go-gost/x` used by `go-gost/` via `replace github.com/go-gost/x => ./x`. Most protocol/runtime behavior changes happen here. 30+ top-level packages - framework-style layout.
|
|
|
|
## STRUCTURE
|
|
```
|
|
go-gost/x/
|
|
├── api/ # Gin management API + embedded swagger docs (22 files)
|
|
├── config/ # Config model + parsing/load/reload
|
|
├── connector/ # Outbound connect implementations
|
|
├── dialer/ # Outbound dialers (tcp/tls/ws/quic/...)
|
|
├── handler/ # Protocol handlers (socks/http/tunnel/relay/...)
|
|
├── listener/ # Inbound listeners (tcp/udp/tun/tap/redirect/...)
|
|
├── limiter/ # Traffic/rate/conn limiters
|
|
├── registry/ # Registries for services/handlers/listeners/etc (20 files)
|
|
├── service/ # Service wrappers + reporting hooks
|
|
├── socket/ # WebSocket reporter / panel integration (6 files)
|
|
└── internal/ # Shared internals (grpc proto, net utils, sniffing, tls, ...)
|
|
```
|
|
|
|
## WHERE TO LOOK
|
|
| Task | Location | Notes |
|
|
|------|----------|-------|
|
|
| **Management API routes/auth** | `go-gost/x/api/api.go` | `/docs`, `/config/*`; BasicAuth + interceptor |
|
|
| **Service config parsing** | `go-gost/x/config/parsing/` | Converts config to running services |
|
|
| **Add a handler** | `go-gost/x/handler/` | Per-protocol subdirs |
|
|
| **Add a listener/dialer** | `go-gost/x/listener/`, `go-gost/x/dialer/` | Transport variants |
|
|
| **Panel reporting** | `go-gost/x/socket/` | WebSocket + HTTP report URL hooks |
|
|
| **Register new component** | `go-gost/x/registry/` | `Register{Type}(name, creator)` |
|
|
|
|
## CONVENTIONS
|
|
- `go-gost/x/` is a standalone Go module (`go-gost/x/go.mod`); run go tooling from this dir when debugging module resolution.
|
|
- Generated gRPC/proto code lives under `go-gost/x/internal/util/grpc/proto/`.
|
|
- Handlers/listeners/dialers follow consistent pattern: `{type}.go` + `metadata.go` per protocol.
|
|
- OS-specific code uses `name_[os].go` suffix (e.g., `tun_linux.go`, `tun_darwin.go`).
|
|
|
|
## ANTI-PATTERNS
|
|
- Do not edit generated files in `go-gost/x/internal/util/grpc/proto/` (`*.pb.go`, `*_grpc.pb.go`).
|
|
|
|
## COMMANDS
|
|
```bash
|
|
cd go-gost/x
|
|
go test ./...
|
|
``` |