Files
ironmount/internal/driver/get.go
Nicolas Meienberger 388114d536 feat: missing endpoints
2025-08-09 18:30:36 +02:00

30 lines
487 B
Go

package driver
import (
"encoding/json"
"log"
"net/http"
)
func Get(w http.ResponseWriter, r *http.Request) {
log.Printf("Received get request: %s", r.URL.Path)
var req struct {
Name string
}
_ = json.NewDecoder(r.Body).Decode(&req)
vol := volumes[req.Name]
response := map[string]any{
"Volume": map[string]any{
"Name": vol.Name,
"Mountpoint": vol.Path,
"Status": map[string]string{},
},
"Err": "",
}
_ = json.NewEncoder(w).Encode(response)
}