streams

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileReader

type FileReader struct {
	io.Reader
	// contains filtered or unexported fields
}

func NewFileReader

func NewFileReader(reader io.Reader, fd uint) *FileReader

func (*FileReader) Fd

func (f *FileReader) Fd() uintptr

type FileWriter

type FileWriter struct {
	io.Writer
	// contains filtered or unexported fields
}

func NewFileWriter

func NewFileWriter(reader io.Writer, fd uint) *FileWriter

func (*FileWriter) Fd

func (f *FileWriter) Fd() uintptr

type Streams

type Streams struct {
	In     terminal.FileReader
	Out    terminal.FileWriter
	ErrOut io.Writer
}

Streams encapsulates I/O streams.

func NewStdStreams

func NewStdStreams() *Streams

NewStdStreams returns a Streams object bound to stdin, stdout, stderr.

func NewStreams

func NewStreams(streams genericclioptions.IOStreams) *Streams

NewStreams returns a Streams object from an underlying genericclioptions.IOStreams.

func NewTTYStreams

func NewTTYStreams(tty *os.File) *Streams

NewTTYStreams returns a Streams object from a TTY file.

func (*Streams) Print

func (s *Streams) Print(args ...interface{})

Print writes to the output stream.

func (*Streams) Printf

func (s *Streams) Printf(format string, args ...interface{})

Printf writes to the output stream.

func (*Streams) Println

func (s *Streams) Println(args ...interface{})

Println writes to the output stream.

func (*Streams) SetCmdOutput

func (s *Streams) SetCmdOutput(cmd *cobra.Command)

SetCmdOutput updates the output streams of the command to itself.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL