mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat: missing endpoints
This commit is contained in:
29
internal/driver/get.go
Normal file
29
internal/driver/get.go
Normal file
@@ -0,0 +1,29 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user