File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 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 }
You can’t perform that action at this time.
0 commit comments