Add streamOverrideWrapper to intercepts command.Cli stream methods and transparently returns custom streams when provided via options

Add new GetConfiguredStreams function to Compose API definition

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
Guillaume Lours
2025-10-24 16:32:45 +02:00
committed by Nicolas De loof
parent e1678c5c43
commit 86e91e010d
7 changed files with 72 additions and 19 deletions

View File

@@ -99,6 +99,9 @@ type Compose interface {
Generate(ctx context.Context, options GenerateOptions) (*types.Project, error)
// Volumes executes the equivalent to a `docker volume ls`
Volumes(ctx context.Context, project string, options VolumesOptions) ([]VolumesSummary, error)
// GetConfiguredStreams returns the configured I/O streams (stdout, stderr, stdin).
// If no custom streams were configured, it returns the dockerCli streams.
GetConfiguredStreams() (stdout io.Writer, stderr io.Writer, stdin io.Reader)
}
type VolumesOptions struct {