mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-06-19 13:28:58 -04:00
Bumps [github.com/testcontainers/testcontainers-go/modules/opensearch](https://github.com/testcontainers/testcontainers-go) from 0.41.0 to 0.42.0. - [Release notes](https://github.com/testcontainers/testcontainers-go/releases) - [Commits](https://github.com/testcontainers/testcontainers-go/compare/v0.41.0...v0.42.0) --- updated-dependencies: - dependency-name: github.com/testcontainers/testcontainers-go/modules/opensearch dependency-version: 0.42.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
41 lines
1.0 KiB
Go
41 lines
1.0 KiB
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
"net/url"
|
|
)
|
|
|
|
// ContainerStartOptions holds options for [Client.ContainerStart].
|
|
type ContainerStartOptions struct {
|
|
CheckpointID string
|
|
CheckpointDir string
|
|
}
|
|
|
|
// ContainerStartResult holds the result of [Client.ContainerStart],
|
|
type ContainerStartResult struct {
|
|
// Add future fields here.
|
|
}
|
|
|
|
// ContainerStart sends a request to the docker daemon to start a container.
|
|
func (cli *Client) ContainerStart(ctx context.Context, containerID string, options ContainerStartOptions) (ContainerStartResult, error) {
|
|
containerID, err := trimID("container", containerID)
|
|
if err != nil {
|
|
return ContainerStartResult{}, err
|
|
}
|
|
|
|
query := url.Values{}
|
|
if options.CheckpointID != "" {
|
|
query.Set("checkpoint", options.CheckpointID)
|
|
}
|
|
if options.CheckpointDir != "" {
|
|
query.Set("checkpoint-dir", options.CheckpointDir)
|
|
}
|
|
|
|
resp, err := cli.post(ctx, "/containers/"+containerID+"/start", query, nil, nil)
|
|
defer ensureReaderClosed(resp)
|
|
if err != nil {
|
|
return ContainerStartResult{}, err
|
|
}
|
|
return ContainerStartResult{}, nil
|
|
}
|