1
0
mirror of https://github.com/rancher/os.git synced 2025-07-06 19:38:37 +00:00
os/vendor/github.com/docker/engine-api/client/container_export.go
Darren Shepherd a14846152b Update vendor
2016-05-31 18:14:32 -07:00

21 lines
482 B
Go

package client
import (
"io"
"net/url"
"golang.org/x/net/context"
)
// 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(ctx context.Context, containerID string) (io.ReadCloser, error) {
serverResp, err := cli.get(ctx, "/containers/"+containerID+"/export", url.Values{}, nil)
if err != nil {
return nil, err
}
return serverResp.body, nil
}