Create interface that clients that talk to the api must fulfill.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 8b15839ee85b291266d07f97d9ad6ca0326d1339
Component: engine
This commit is contained in:
David Calavera
2015-12-04 17:02:06 -05:00
parent 68562127c9
commit 964dd12e59
29 changed files with 283 additions and 208 deletions

View File

@ -3,21 +3,13 @@ package lib
import (
"io"
"net/url"
"github.com/docker/docker/api/types"
)
// CreateImageOptions holds information to create images.
type CreateImageOptions struct {
// Parent is the image to create this image from
Parent string
// Tag is the name to tag this image
Tag string
// RegistryAuth is the base64 encoded credentials for this server
RegistryAuth string
}
// CreateImage creates a new image based in the parent options.
// ImageCreate creates a new image based in the parent options.
// It returns the JSON content in the response body.
func (cli *Client) CreateImage(options CreateImageOptions) (io.ReadCloser, error) {
func (cli *Client) ImageCreate(options types.ImageCreateOptions) (io.ReadCloser, error) {
var query url.Values
query.Set("fromImage", options.Parent)
query.Set("tag", options.Tag)