mirror of
https://github.com/docker/compose.git
synced 2025-11-16 20:00:21 +01:00
This commit prepares the Compose service for SDK usage by abstracting away the hard dependency on command.Cli. The Docker CLI remains the standard path for the CLI tool, but SDK users can now provide custom implementations of streams and context information. Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
44 lines
1.1 KiB
Go
44 lines
1.1 KiB
Go
/*
|
|
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
|
|
}
|