1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/api/client/lib/export.go
David Calavera d9a62c5f2b Lowercase http method functions.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-09 12:04:59 -05:00

18 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
}