()
| 10 | ) |
| 11 | |
| 12 | func ExampleClient_ContainerWait_withTimeout() { |
| 13 | apiClient, err := client.New( |
| 14 | client.FromEnv, |
| 15 | client.WithUserAgent("my-application/1.0.0"), |
| 16 | ) |
| 17 | if err != nil { |
| 18 | log.Fatal(err) |
| 19 | } |
| 20 | |
| 21 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |
| 22 | defer cancel() |
| 23 | wait := apiClient.ContainerWait(ctx, "my_container_id", client.ContainerWaitOptions{ |
| 24 | Condition: container.WaitConditionNotRunning, |
| 25 | }) |
| 26 | if err := <-wait.Error; err != nil { |
| 27 | log.Fatal(err) |
| 28 | } |
| 29 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…