feat: add e2e tests, fix server shutdown and map race, update docs
- Add end-to-end test suite covering HTTP tunnel round-trip, POST forwarding, unknown tunnel 404, duplicate name rejection, unauthorized access, info endpoint, multi-tunnel routing, and graceful shutdown - Fix server graceful shutdown by closing TCP listener on context cancel - Fix data race in pkg/maps Entries() iterator by holding RLock - Rewrite README with architecture, configuration, and usage docs - Add AGENTS.md with project conventions and architecture guide - Update flake.nix (add gopls) and flake.lock
This commit is contained in:
@@ -42,6 +42,8 @@ func (m *Map[K, V]) HasKey(key K) bool {
|
||||
|
||||
func (m *Map[K, V]) Entries() iter.Seq2[K, V] {
|
||||
return func(yield func(K, V) bool) {
|
||||
m.mu.RLock()
|
||||
defer m.mu.RUnlock()
|
||||
for k, v := range m.items {
|
||||
if !yield(k, v) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user