diff --git a/pkg/api/io.go b/pkg/api/io.go deleted file mode 100644 index 44bf30088df..00000000000 --- a/pkg/api/io.go +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2020 Docker Compose CLI authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package api - -import ( - "io" -) - -// OutputStream is a writable stream with terminal detection capabilities -type OutputStream interface { - io.Writer - - // IsTerminal returns true if the stream is connected to a terminal - IsTerminal() bool - - // FD returns the file descriptor for the stream - FD() uintptr -} - -// InputStream is a readable stream with terminal detection capabilities -type InputStream interface { - io.Reader - - // IsTerminal returns true if the stream is connected to a terminal - IsTerminal() bool - - // FD returns the file descriptor for the stream - FD() uintptr -} diff --git a/pkg/compose/compose.go b/pkg/compose/compose.go index c44849d069c..0e40a4785cf 100644 --- a/pkg/compose/compose.go +++ b/pkg/compose/compose.go @@ -104,7 +104,7 @@ func NewComposeService(dockerCli command.Cli, options ...Option) (api.Compose, e } // WithStreams sets custom I/O streams for output and interaction -func WithStreams(out, err api.OutputStream, in api.InputStream) Option { +func WithStreams(out, err io.Writer, in io.Reader) Option { return func(s *composeService) error { s.outStream = out s.errStream = err @@ -114,7 +114,7 @@ func WithStreams(out, err api.OutputStream, in api.InputStream) Option { } // WithOutputStream sets a custom output stream -func WithOutputStream(out api.OutputStream) Option { +func WithOutputStream(out io.Writer) Option { return func(s *composeService) error { s.outStream = out return nil @@ -122,7 +122,7 @@ func WithOutputStream(out api.OutputStream) Option { } // WithErrorStream sets a custom error stream -func WithErrorStream(err api.OutputStream) Option { +func WithErrorStream(err io.Writer) Option { return func(s *composeService) error { s.errStream = err return nil @@ -130,7 +130,7 @@ func WithErrorStream(err api.OutputStream) Option { } // WithInputStream sets a custom input stream -func WithInputStream(in api.InputStream) Option { +func WithInputStream(in io.Reader) Option { return func(s *composeService) error { s.inStream = in return nil @@ -197,9 +197,9 @@ type composeService struct { prompt Prompt // Optional overrides for specific components (for SDK users) - outStream api.OutputStream - errStream api.OutputStream - inStream api.InputStream + outStream io.Writer + errStream io.Writer + inStream io.Reader contextInfo api.ContextInfo proxyConfig map[string]string