Files
docker-cli/components/engine/api/client/lib/export.go
David Calavera f30cba0e0e Implement docker export with standalone client lib.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: e0549b8cebee4dbe8614688767c9b666afdd32d9
Component: engine
2015-12-09 12:04:54 -05:00

19 lines
424 B
Go

package lib
import (
"io"
"net/url"
)
// ContainerExport retrieves the raw contents of a container
// and returns them as a io.ReadCloser. It's up to the caller
// to close the stream.
func (cli *Client) ContainerExport(containerID string) (io.ReadCloser, error) {
serverResp, err := cli.GET("/containers/"+containerID+"/export", url.Values{}, nil)
if err != nil {
return nil, err
}
return serverResp.body, nil
}