feat: basic volume plugin commands

This commit is contained in:
Nicolas Meienberger
2025-08-09 12:36:16 +02:00
parent 8d86f56b87
commit e7463d34ef
13 changed files with 222 additions and 9 deletions

22
internal/driver/path.go Normal file
View File

@@ -0,0 +1,22 @@
package driver
import (
"encoding/json"
"net/http"
)
func Path(w http.ResponseWriter, r *http.Request) {
var req PathRequest
_ = json.NewDecoder(r.Body).Decode(&req)
vol, ok := volumes[req.Name]
if !ok {
_ = json.NewEncoder(w).Encode(map[string]string{"Err": "volume not found"})
return
}
_ = json.NewEncoder(w).Encode(map[string]string{
"Mountpoint": vol.Path,
"Err": "",
})
}