Backend Go 1.23+ : - API REST + WebSocket (chi, gorilla/websocket) - Authentification PAM via SSH + JWT RS256 - Chiffrement AES-256-GCM pour secrets SQLite - Pool SSH, client Proxmox REST, hub WebSocket pub/sub - Système de modules compilés à initialisation conditionnelle - Audit log, migrations SQLite versionnées Frontend Vue 3 + Vite + TypeScript : - Thème Neumorphism sombre/clair (CSS custom properties) - Wizard d'installation, Dashboard drag-drop, Terminal xterm.js - Toutes les vues CORE + stubs modules optionnels - i18n EN/FR (vue-i18n v11) Infrastructure : - Docker multi-stage (Go → alpine, Node → nginx) - docker-compose.yml, .gitattributes, LICENSE MIT, README Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
16 lines
404 B
Go
16 lines
404 B
Go
// Fonctions utilitaires partagées entre les handlers API.
|
|
package api
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
)
|
|
|
|
// decodeJSON décode le corps JSON d'une requête dans dest.
|
|
// Retourne une erreur si le corps est invalide ou manquant.
|
|
func decodeJSON(r *http.Request, dest any) error {
|
|
if r.Body == nil {
|
|
return json.NewDecoder(r.Body).Decode(dest)
|
|
}
|
|
return json.NewDecoder(r.Body).Decode(dest)
|
|
}
|