From 0273bc6921b13e40e3278f63e8ff4677585f606f Mon Sep 17 00:00:00 2001 From: root Date: Wed, 4 Feb 2026 06:36:03 +0000 Subject: [PATCH] docs: add AGENTS.md for go-gost/x/registry --- go-gost/x/registry/AGENTS.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 go-gost/x/registry/AGENTS.md diff --git a/go-gost/x/registry/AGENTS.md b/go-gost/x/registry/AGENTS.md new file mode 100644 index 0000000..10f5ab1 --- /dev/null +++ b/go-gost/x/registry/AGENTS.md @@ -0,0 +1,29 @@ +# GO-GOST REGISTRY KNOWLEDGE BASE + +**Generated:** Wed Feb 04 2026 + +## OVERVIEW +Central registration point for all pluggable GOST components (handlers, listeners, dialers, etc.). +Allows the configuration system to resolve string types (e.g., "socks5") to actual Go implementations. + +## STRUCTURE +One file per component type, exporting a standard Registry interface. +``` +go-gost/x/registry/ +├── handler.go # RegisterHandler(name, newFunc) +├── listener.go # RegisterListener(name, newFunc) +├── dialer.go # RegisterDialer(name, newFunc) +└── ... # Same pattern for auth, bypass, admission +``` + +## WHERE TO LOOK +| Task | Location | Notes | +|------|----------|-------| +| Register a new component | `go-gost/x/registry/{type}.go` | Use `Register{Type}(name, creator)` | +| Component lookup | `go-gost/x/registry/{type}.go` | `Get{Type}(name)` returns the creator function | +| Default registrations | `go-gost/x/` (init functions) | Most components register themselves in their package `init()` | + +## CONVENTIONS +- Thread-safe maps used for storage. +- Names are case-sensitive (usually lowercase). +- Components must be registered *before* the configuration parser runs (usually done via `import _ "..."` in `main.go`).