@@ -12,18 +12,19 @@ import (
1212 "strings"
1313
1414 "github.com/docker/docker/api/types"
15+ "github.com/docker/docker/api/types/container"
1516)
1617
1718// ContainerStatPath returns stat information about a path inside the container filesystem.
18- func (cli * Client ) ContainerStatPath (ctx context.Context , containerID , path string ) (types. ContainerPathStat , error ) {
19+ func (cli * Client ) ContainerStatPath (ctx context.Context , containerID , path string ) (container. PathStat , error ) {
1920 query := url.Values {}
2021 query .Set ("path" , filepath .ToSlash (path )) // Normalize the paths used in the API.
2122
2223 urlStr := "/containers/" + containerID + "/archive"
2324 response , err := cli .head (ctx , urlStr , query , nil )
2425 defer ensureReaderClosed (response )
2526 if err != nil {
26- return types. ContainerPathStat {}, err
27+ return container. PathStat {}, err
2728 }
2829 return getContainerPathStatFromHeader (response .header )
2930}
@@ -55,14 +56,14 @@ func (cli *Client) CopyToContainer(ctx context.Context, containerID, dstPath str
5556
5657// CopyFromContainer gets the content from the container and returns it as a Reader
5758// for a TAR archive to manipulate it in the host. It's up to the caller to close the reader.
58- func (cli * Client ) CopyFromContainer (ctx context.Context , containerID , srcPath string ) (io.ReadCloser , types. ContainerPathStat , error ) {
59+ func (cli * Client ) CopyFromContainer (ctx context.Context , containerID , srcPath string ) (io.ReadCloser , container. PathStat , error ) {
5960 query := make (url.Values , 1 )
6061 query .Set ("path" , filepath .ToSlash (srcPath )) // Normalize the paths used in the API.
6162
6263 apiPath := "/containers/" + containerID + "/archive"
6364 response , err := cli .get (ctx , apiPath , query , nil )
6465 if err != nil {
65- return nil , types. ContainerPathStat {}, err
66+ return nil , container. PathStat {}, err
6667 }
6768
6869 // In order to get the copy behavior right, we need to know information
@@ -78,8 +79,8 @@ func (cli *Client) CopyFromContainer(ctx context.Context, containerID, srcPath s
7879 return response .body , stat , err
7980}
8081
81- func getContainerPathStatFromHeader (header http.Header ) (types. ContainerPathStat , error ) {
82- var stat types. ContainerPathStat
82+ func getContainerPathStatFromHeader (header http.Header ) (container. PathStat , error ) {
83+ var stat container. PathStat
8384
8485 encodedStat := header .Get ("X-Docker-Container-Path-Stat" )
8586 statDecoder := base64 .NewDecoder (base64 .StdEncoding , strings .NewReader (encodedStat ))
0 commit comments