two/internal/api/agent/vpcs.go
GnomeZworc 8637c33bd8
f-21: code: ajout d'un system de worker
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2026-04-16 22:59:10 +02:00

24 lines
508 B
Go

package agentapi
import (
"encoding/json"
"net/http"
)
func (s *Server) VpcsHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
switch r.Method {
case http.MethodGet:
w.WriteHeader(http.StatusOK)
json.NewEncoder(w).Encode([]interface{}{})
case http.MethodPost:
s.queue.Submit(func() {
createVpc()
})
w.WriteHeader(http.StatusAccepted)
default:
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
}
}
func createVpc() {}