summaryrefslogtreecommitdiff
path: root/vendor/github.com/fsouza/go-dockerclient/container_resize.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/fsouza/go-dockerclient/container_resize.go')
-rw-r--r--vendor/github.com/fsouza/go-dockerclient/container_resize.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/github.com/fsouza/go-dockerclient/container_resize.go b/vendor/github.com/fsouza/go-dockerclient/container_resize.go
new file mode 100644
index 000000000..3445be6b5
--- /dev/null
+++ b/vendor/github.com/fsouza/go-dockerclient/container_resize.go
@@ -0,0 +1,22 @@
+package docker
+
+import (
+ "net/http"
+ "net/url"
+ "strconv"
+)
+
+// ResizeContainerTTY resizes the terminal to the given height and width.
+//
+// See https://goo.gl/FImjeq for more details.
+func (c *Client) ResizeContainerTTY(id string, height, width int) error {
+ params := make(url.Values)
+ params.Set("h", strconv.Itoa(height))
+ params.Set("w", strconv.Itoa(width))
+ resp, err := c.do(http.MethodPost, "/containers/"+id+"/resize?"+params.Encode(), doOptions{})
+ if err != nil {
+ return err
+ }
+ resp.Body.Close()
+ return nil
+}