github.com/vvnotw/moby@v1.13.1/client/container_diff.go (about)

     1  package client
     2  
     3  import (
     4  	"encoding/json"
     5  	"net/url"
     6  
     7  	"github.com/docker/docker/api/types"
     8  	"golang.org/x/net/context"
     9  )
    10  
    11  // ContainerDiff shows differences in a container filesystem since it was started.
    12  func (cli *Client) ContainerDiff(ctx context.Context, containerID string) ([]types.ContainerChange, error) {
    13  	var changes []types.ContainerChange
    14  
    15  	serverResp, err := cli.get(ctx, "/containers/"+containerID+"/changes", url.Values{}, nil)
    16  	if err != nil {
    17  		return changes, err
    18  	}
    19  
    20  	err = json.NewDecoder(serverResp.body).Decode(&changes)
    21  	ensureReaderClosed(serverResp)
    22  	return changes, err
    23  }