Files
opencloud/vendor/github.com/moby/moby/client/task_inspect.go
dependabot[bot] d88bd1aa59 build(deps): bump github.com/testcontainers/testcontainers-go/modules/opensearch
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>
2026-04-22 11:29:03 +02:00

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
}