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>
37 lines
863 B
Go
37 lines
863 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
|
|
"github.com/moby/moby/api/types/swarm"
|
|
)
|
|
|
|
// TaskInspectOptions contains options for inspecting a task.
|
|
type TaskInspectOptions struct {
|
|
// Currently no options are defined.
|
|
}
|
|
|
|
// TaskInspectResult contains the result of a task inspection.
|
|
type TaskInspectResult struct {
|
|
Task swarm.Task
|
|
Raw json.RawMessage
|
|
}
|
|
|
|
// TaskInspect returns the task information and its raw representation.
|
|
func (cli *Client) TaskInspect(ctx context.Context, taskID string, options TaskInspectOptions) (TaskInspectResult, error) {
|
|
taskID, err := trimID("task", taskID)
|
|
if err != nil {
|
|
return TaskInspectResult{}, err
|
|
}
|
|
|
|
resp, err := cli.get(ctx, "/tasks/"+taskID, nil, nil)
|
|
if err != nil {
|
|
return TaskInspectResult{}, err
|
|
}
|
|
|
|
var out TaskInspectResult
|
|
out.Raw, err = decodeWithRaw(resp, &out.Task)
|
|
return out, err
|
|
}
|