summaryrefslogtreecommitdiff
path: root/pkg/bindings/mount.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/bindings/mount.go')
-rw-r--r--pkg/bindings/mount.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/pkg/bindings/mount.go b/pkg/bindings/mount.go
new file mode 100644
index 000000000..2e3d6d7f6
--- /dev/null
+++ b/pkg/bindings/mount.go
@@ -0,0 +1,26 @@
+package bindings
+
+import (
+ "fmt"
+ "net/http"
+)
+
+func (c Connection) MountContainer(nameOrID string) (string, error) {
+ var (
+ path string
+ )
+ response, err := c.newRequest(http.MethodPost, fmt.Sprintf("/containers/%s/mount", nameOrID), nil, nil)
+ if err != nil {
+ return path, err
+ }
+ return path, response.Process(&path)
+}
+
+func (c Connection) GetMountedContainerPaths() (map[string]string, error) {
+ mounts := make(map[string]string)
+ response, err := c.newRequest(http.MethodGet, "/containers/showmounted", nil, nil)
+ if err != nil {
+ return mounts, err
+ }
+ return mounts, response.Process(&mounts)
+}