refactor(session): add registry to manage SSH sessions
All checks were successful
renovate / renovate (push) Successful in 39s
Docker Build and Push / build-and-push-branches (push) Successful in 4m27s
Docker Build and Push / build-and-push-tags (push) Successful in 4m22s

- Implement thread-safe session registry with sync.RWMutex
- Add Registry interface for session management operations
- Support Get, Register, Update, and Remove session operations
- Enable dynamic slug updates for existing sessions
This commit is contained in:
2025-12-31 17:47:35 +07:00
parent acd02aadd3
commit f8a6f0bafe
10 changed files with 218 additions and 224 deletions

View File

@@ -9,6 +9,7 @@ import (
"tunnel_pls/internal/config"
"tunnel_pls/internal/key"
"tunnel_pls/server"
"tunnel_pls/session"
"tunnel_pls/version"
"golang.org/x/crypto/ssh"
@@ -58,6 +59,11 @@ func main() {
}
sshConfig.AddHostKey(private)
app := server.NewServer(sshConfig)
sessionRegistry := session.NewRegistry()
app, err := server.NewServer(sshConfig, sessionRegistry)
if err != nil {
log.Fatalf("Failed to start server: %s", err)
}
app.Start()
}