Skip to content

Commit a0deebd

Browse files
committed
this shouldn't matter, right?
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 8d8c3fb commit a0deebd

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

internal/jsonstream/display.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"io"
66

7-
"github.com/docker/cli/cli/streams"
87
"github.com/moby/moby/api/types/jsonstream"
98
"github.com/moby/moby/client/pkg/jsonmessage"
109
)
@@ -41,13 +40,24 @@ func WithAuxCallback(cb func(JSONMessage)) Options {
4140
}
4241
}
4342

43+
// Stream is an io.Writer for output with utilities to get the output's file
44+
// descriptor and to detect whether it's a terminal.
45+
//
46+
// it is subset of the streams.Out type in
47+
// https://pkg.go.dev/github.com/docker/cli@v20.10.17+incompatible/cli/streams#Out
48+
type Stream interface {
49+
io.Writer
50+
FD() uintptr
51+
IsTerminal() bool
52+
}
53+
4454
// Display prints the JSON messages from the given reader to the given stream.
4555
//
4656
// It wraps the [jsonmessage.DisplayJSONMessagesStream] function to make it
4757
// "context aware" and appropriately returns why the function was canceled.
4858
//
4959
// It returns an error if the context is canceled, but not if the input reader / stream is closed.
50-
func Display(ctx context.Context, in io.Reader, stream *streams.Out, opts ...Options) error {
60+
func Display(ctx context.Context, in io.Reader, stream Stream, opts ...Options) error {
5161
if ctx.Err() != nil {
5262
return ctx.Err()
5363
}

0 commit comments

Comments
 (0)