withBackend creates a compose backend and passes it to fn.
(dockerCli command.Cli, opts *BackendOptions, fn func(api.Compose) error)
| 27 | |
| 28 | // withBackend creates a compose backend and passes it to fn. |
| 29 | func withBackend(dockerCli command.Cli, opts *BackendOptions, fn func(api.Compose) error) error { |
| 30 | backend, err := compose.NewComposeService(dockerCli, opts.Options...) |
| 31 | if err != nil { |
| 32 | return err |
| 33 | } |
| 34 | return fn(backend) |
| 35 | } |
| 36 | |
| 37 | // optionalTimeout converts an integer timeout (in seconds) into a *time.Duration. |
| 38 | // If changed is false, nil is returned (no timeout was explicitly set). |
no test coverage detected