mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-27 04:11:03 +00:00
75513575be
* store dependency's in git * since we vendor ... rm tech-depts * aad make target 'vendor' to update vendor folder (manual task)
28 lines
798 B
Go
28 lines
798 B
Go
package docker // import "docker.io/go-docker"
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/url"
|
|
|
|
"docker.io/go-docker/api/types"
|
|
"golang.org/x/net/context"
|
|
)
|
|
|
|
// CheckpointList returns the checkpoints of the given container in the docker host
|
|
func (cli *Client) CheckpointList(ctx context.Context, container string, options types.CheckpointListOptions) ([]types.Checkpoint, error) {
|
|
var checkpoints []types.Checkpoint
|
|
|
|
query := url.Values{}
|
|
if options.CheckpointDir != "" {
|
|
query.Set("dir", options.CheckpointDir)
|
|
}
|
|
|
|
resp, err := cli.get(ctx, "/containers/"+container+"/checkpoints", query, nil)
|
|
if err != nil {
|
|
return checkpoints, wrapResponseError(err, resp, "container", container)
|
|
}
|
|
|
|
err = json.NewDecoder(resp.body).Decode(&checkpoints)
|
|
ensureReaderClosed(resp)
|
|
return checkpoints, err
|
|
}
|