(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts portOptions, service string)
| 64 | } |
| 65 | |
| 66 | func runPort(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts portOptions, service string) error { |
| 67 | projectName, err := opts.toProjectName(ctx, dockerCli) |
| 68 | if err != nil { |
| 69 | return err |
| 70 | } |
| 71 | |
| 72 | backend, err := compose.NewComposeService(dockerCli, backendOptions.Options...) |
| 73 | if err != nil { |
| 74 | return err |
| 75 | } |
| 76 | ip, port, err := backend.Port(ctx, projectName, service, opts.port, api.PortOptions{ |
| 77 | Protocol: opts.protocol, |
| 78 | Index: opts.index, |
| 79 | }) |
| 80 | if err != nil { |
| 81 | return err |
| 82 | } |
| 83 | |
| 84 | _, _ = fmt.Fprintf(dockerCli.Out(), "%s:%d\n", ip, port) |
| 85 | return nil |
| 86 | } |
no test coverage detected