mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat: basic volume plugin commands
This commit is contained in:
22
internal/driver/path.go
Normal file
22
internal/driver/path.go
Normal 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": "",
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user