1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/api/client/lib/container_inspect.go
David Calavera 0876742646 Implement docker logs with standalone client lib.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-09 12:04:55 -05:00

20 lines
503 B
Go

package lib
import (
"encoding/json"
"github.com/docker/docker/api/types"
)
// ContainerInspect returns the all the container information.
func (cli *Client) ContainerInspect(containerID string) (types.ContainerJSON, error) {
serverResp, err := cli.GET("/containers/"+containerID+"/json", nil, nil)
if err != nil {
return types.ContainerJSON{}, err
}
defer serverResp.body.Close()
var response types.ContainerJSON
json.NewDecoder(serverResp.body).Decode(&response)
return response, err
}