feat: port session 07 — Protocol Parser, Auth extras (TPM/certidp/certstore), Internal utilities & data structures
Session 07 scope (5 features, 17 tests, ~1165 Go LOC): - Protocol/ParserTypes.cs: ParserState enum (79 states), PublishArgument, ParseContext - Protocol/IProtocolHandler.cs: handler interface decoupling parser from client - Protocol/ProtocolParser.cs: Parse(), ProtoSnippet(), OverMaxControlLineLimit(), ProcessPub/HeaderPub/RoutedMsgArgs/RoutedHeaderMsgArgs, ClonePubArg(), GetHeader() - tests/Protocol/ProtocolParserTests.cs: 17 tests via TestProtocolHandler stub Auth extras from session 06 (committed separately): - Auth/TpmKeyProvider.cs, Auth/CertificateIdentityProvider/, Auth/CertificateStore/ Internal utilities & data structures (session 06 overflow): - Internal/AccessTimeService.cs, ElasticPointer.cs, SystemMemory.cs, ProcessStatsProvider.cs - Internal/DataStructures/GenericSublist.cs, HashWheel.cs - Internal/DataStructures/SubjectTree.cs, SubjectTreeNode.cs, SubjectTreeParts.cs All 461 tests pass (460 unit + 1 integration). DB updated for features 2588-2592 and tests 2598-2614.
This commit is contained in:
48
docs/plans/phases/phase6sessions/session-04.md
Normal file
48
docs/plans/phases/phase6sessions/session-04.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# Session 04: Logging, Signals & Services
|
||||
|
||||
## Summary
|
||||
|
||||
Logging infrastructure, OS signal handling (Unix/Windows/WASM), and Windows service management. Small session — good opportunity to also address platform-specific abstractions.
|
||||
|
||||
## Scope
|
||||
|
||||
| Go File | Features | Feature IDs | Go LOC |
|
||||
|---------|----------|-------------|--------|
|
||||
| server/log.go | 18 | 2050–2067 | 207 |
|
||||
| server/signal.go | 5 | 3155–3159 | 156 |
|
||||
| server/signal_wasm.go | 2 | 3160–3161 | 6 |
|
||||
| server/signal_windows.go | 2 | 3162–3163 | 79 |
|
||||
| server/service.go | 2 | 3148–3149 | 7 |
|
||||
| server/service_windows.go | 5 | 3150–3154 | 79 |
|
||||
| **Total** | **34** | | **534** |
|
||||
|
||||
## .NET Classes
|
||||
|
||||
- `NatsLogger` (or logging integration) — server logging wrapper
|
||||
- `SignalHandler` — OS signal handling (SIGTERM, SIGHUP, etc.)
|
||||
- `ServiceManager` — Windows service lifecycle
|
||||
|
||||
## Test Files
|
||||
|
||||
| Test File | Tests | Test IDs |
|
||||
|-----------|-------|----------|
|
||||
| server/log_test.go | 6 | 2017–2022 |
|
||||
| server/signal_test.go | 19 | 2910–2928 |
|
||||
| server/service_test.go | 1 | 2908 |
|
||||
| server/service_windows_test.go | 1 | 2909 |
|
||||
| **Total** | **27** | |
|
||||
|
||||
## Dependencies
|
||||
|
||||
- Session 01 (Foundation Types)
|
||||
|
||||
## .NET Target Location
|
||||
|
||||
- `dotnet/src/ZB.MOM.NatsNet.Server/Internal/` (logging)
|
||||
- `dotnet/src/ZB.MOM.NatsNet.Server.Host/` (signal/service)
|
||||
|
||||
## Notes
|
||||
|
||||
- .NET uses `Microsoft.Extensions.Logging` + Serilog per standards
|
||||
- Windows service support maps to `Microsoft.Extensions.Hosting.WindowsServices`
|
||||
- Signal handling maps to `Console.CancelKeyPress` + `AppDomain.ProcessExit`
|
||||
Reference in New Issue
Block a user