Stop stops and removes the CouchDB container
()
| 299 | |
| 300 | // Stop stops and removes the CouchDB container |
| 301 | func (c *CouchDB) Stop() error { |
| 302 | c.mutex.Lock() |
| 303 | if c.stopped { |
| 304 | c.mutex.Unlock() |
| 305 | return errors.Errorf("container %s already stopped", c.containerID) |
| 306 | } |
| 307 | c.stopped = true |
| 308 | c.mutex.Unlock() |
| 309 | |
| 310 | t := 0 |
| 311 | _, err := c.Client.ContainerStop(context.Background(), c.containerID, dcli.ContainerStopOptions{ |
| 312 | Timeout: &t, |
| 313 | }) |
| 314 | if err != nil { |
| 315 | return err |
| 316 | } |
| 317 | |
| 318 | return nil |
| 319 | } |
no test coverage detected