mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-01 16:46:36 +08:00
1.3 KiB
1.3 KiB
GO-GOST REGISTRY KNOWLEDGE BASE
Generated: Fri Mar 20 2026
Commit: f45f960
Branch: main
Tag: 2.1.9-beta6
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 _ "..."inmain.go).