mirror of https://github.com/docker/docs.git
Godep update github.com/samalba/dockerclient.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
This commit is contained in:
parent
ed0b11e506
commit
9df95842a9
|
@ -125,7 +125,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/samalba/dockerclient",
|
"ImportPath": "github.com/samalba/dockerclient",
|
||||||
"Rev": "9433689e5c6bec5ac2ffa8debf721e88abfb6285"
|
"Rev": "9445e25ed06943cf2828bce5a92391d768513d21"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/samuel/go-zookeeper/zk",
|
"ImportPath": "github.com/samuel/go-zookeeper/zk",
|
||||||
|
|
|
@ -335,6 +335,29 @@ func (client *DockerClient) ExecResize(id string, width, height int) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (client *DockerClient) AttachContainer(id string, options *AttachOptions) (io.ReadCloser, error) {
|
||||||
|
v := url.Values{}
|
||||||
|
if options != nil {
|
||||||
|
if options.Logs {
|
||||||
|
v.Set("logs", "1")
|
||||||
|
}
|
||||||
|
if options.Stream {
|
||||||
|
v.Set("stream", "1")
|
||||||
|
}
|
||||||
|
if options.Stdin {
|
||||||
|
v.Set("stdin", "1")
|
||||||
|
}
|
||||||
|
if options.Stdout {
|
||||||
|
v.Set("stdout", "1")
|
||||||
|
}
|
||||||
|
if options.Stderr {
|
||||||
|
v.Set("stderr", "1")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uri := fmt.Sprintf("/%s/containers/%s/attach?%s", APIVersion, id, v.Encode())
|
||||||
|
return client.doStreamRequest("POST", uri, nil, nil)
|
||||||
|
}
|
||||||
|
|
||||||
func (client *DockerClient) StartContainer(id string, config *HostConfig) error {
|
func (client *DockerClient) StartContainer(id string, config *HostConfig) error {
|
||||||
data, err := json.Marshal(config)
|
data, err := json.Marshal(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -625,17 +648,9 @@ func (client *DockerClient) InspectImage(id string) (*ImageInfo, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (client *DockerClient) LoadImage(reader io.Reader) error {
|
func (client *DockerClient) LoadImage(reader io.Reader) error {
|
||||||
data, err := ioutil.ReadAll(reader)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
uri := fmt.Sprintf("/%s/images/load", APIVersion)
|
uri := fmt.Sprintf("/%s/images/load", APIVersion)
|
||||||
_, err = client.doRequest("POST", uri, data, nil)
|
_, err := client.doStreamRequest("POST", uri, reader, nil)
|
||||||
if err != nil {
|
return err
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (client *DockerClient) RemoveContainer(id string, force, volumes bool) error {
|
func (client *DockerClient) RemoveContainer(id string, force, volumes bool) error {
|
||||||
|
|
|
@ -20,6 +20,7 @@ type Client interface {
|
||||||
ExecStart(id string, config *ExecConfig) error
|
ExecStart(id string, config *ExecConfig) error
|
||||||
ExecResize(id string, width, height int) error
|
ExecResize(id string, width, height int) error
|
||||||
StartContainer(id string, config *HostConfig) error
|
StartContainer(id string, config *HostConfig) error
|
||||||
|
AttachContainer(id string, options *AttachOptions) (io.ReadCloser, error)
|
||||||
StopContainer(id string, timeout int) error
|
StopContainer(id string, timeout int) error
|
||||||
RestartContainer(id string, timeout int) error
|
RestartContainer(id string, timeout int) error
|
||||||
KillContainer(id, signal string) error
|
KillContainer(id, signal string) error
|
||||||
|
|
|
@ -50,6 +50,11 @@ func (client *MockClient) ContainerChanges(id string) ([]*dockerclient.Container
|
||||||
return args.Get(0).([]*dockerclient.ContainerChanges), args.Error(1)
|
return args.Get(0).([]*dockerclient.ContainerChanges), args.Error(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (client *MockClient) AttachContainer(id string, options *dockerclient.AttachOptions) (io.ReadCloser, error) {
|
||||||
|
args := client.Mock.Called(id, options)
|
||||||
|
return args.Get(0).(io.ReadCloser), args.Error(1)
|
||||||
|
}
|
||||||
|
|
||||||
func (client *MockClient) StartContainer(id string, config *dockerclient.HostConfig) error {
|
func (client *MockClient) StartContainer(id string, config *dockerclient.HostConfig) error {
|
||||||
args := client.Mock.Called(id, config)
|
args := client.Mock.Called(id, config)
|
||||||
return args.Error(0)
|
return args.Error(0)
|
||||||
|
|
|
@ -46,6 +46,10 @@ func (client *NopClient) ContainerChanges(id string) ([]*dockerclient.ContainerC
|
||||||
return nil, ErrNoEngine
|
return nil, ErrNoEngine
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (client *NopClient) AttachContainer(id string, options *dockerclient.AttachOptions) (io.ReadCloser, error) {
|
||||||
|
return nil, ErrNoEngine
|
||||||
|
}
|
||||||
|
|
||||||
func (client *NopClient) StartContainer(id string, config *dockerclient.HostConfig) error {
|
func (client *NopClient) StartContainer(id string, config *dockerclient.HostConfig) error {
|
||||||
return ErrNoEngine
|
return ErrNoEngine
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,6 +112,14 @@ type LogOptions struct {
|
||||||
Tail int64
|
Tail int64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type AttachOptions struct {
|
||||||
|
Logs bool
|
||||||
|
Stream bool
|
||||||
|
Stdin bool
|
||||||
|
Stdout bool
|
||||||
|
Stderr bool
|
||||||
|
}
|
||||||
|
|
||||||
type MonitorEventsFilters struct {
|
type MonitorEventsFilters struct {
|
||||||
Event string `json:",omitempty"`
|
Event string `json:",omitempty"`
|
||||||
Image string `json:",omitempty"`
|
Image string `json:",omitempty"`
|
||||||
|
@ -510,6 +518,7 @@ type NetworkCreate struct {
|
||||||
CheckDuplicate bool
|
CheckDuplicate bool
|
||||||
Driver string
|
Driver string
|
||||||
IPAM IPAM
|
IPAM IPAM
|
||||||
|
Options map[string]string
|
||||||
}
|
}
|
||||||
|
|
||||||
// NetworkCreateResponse is the response message sent by the server for network create call
|
// NetworkCreateResponse is the response message sent by the server for network create call
|
||||||
|
|
Loading…
Reference in New Issue