mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 20:52:33 +02:00
19 lines
393 B
Go
19 lines
393 B
Go
package docker
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
E "github.com/yusing/go-proxy/internal/error"
|
|
)
|
|
|
|
func (c Client) Inspect(containerID string) (*Container, E.NestedError) {
|
|
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
|
|
defer cancel()
|
|
|
|
json, err := c.ContainerInspect(ctx, containerID)
|
|
if err != nil {
|
|
return nil, E.From(err)
|
|
}
|
|
return FromJSON(json, c.key), nil
|
|
}
|