mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
9fd2c0feb0
Signed-off-by: David Calavera <david.calavera@gmail.com>
22 lines
566 B
Go
22 lines
566 B
Go
package lib
|
|
|
|
import (
|
|
"io"
|
|
"net/url"
|
|
|
|
"github.com/docker/docker/api/types"
|
|
)
|
|
|
|
// ImageLoad loads an image in the docker host from the client host.
|
|
// It's up to the caller to close the io.ReadCloser returned by
|
|
// this function.
|
|
func (cli *Client) ImageLoad(input io.Reader) (types.ImageLoadResponse, error) {
|
|
resp, err := cli.postRaw("/images/load", url.Values{}, input, nil)
|
|
if err != nil {
|
|
return types.ImageLoadResponse{}, err
|
|
}
|
|
return types.ImageLoadResponse{
|
|
Body: resp.body,
|
|
JSON: resp.header.Get("Content-Type") == "application/json",
|
|
}, nil
|
|
}
|