ioproxy

package
v0.0.0-...-8528295 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IoProxy

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

IoProxy is a proxy writer which adds the output prefix before writing data.

func New

func New(w io.Writer, prefix StdType, lock *sync.Mutex) *IoProxy

New will return a new IoProxy instance.

func (*IoProxy) Flush

func (w *IoProxy) Flush() error

Flush will write all buffer data still present.

func (*IoProxy) Write

func (w *IoProxy) Write(p []byte) (int, error)

Write will write given data to the an internal buffer, which will be flushed if a newline is encountered, of when the maximum size of the buffer has been reached.

type StdType

type StdType byte

StdType is the type of standard stream a writer can multiplex to.

const (
	// Stdin represents standard input stream type.
	Stdin StdType = iota
	// Stdout represents standard output stream type.
	Stdout
	// Stderr represents standard error steam type.
	Stderr
)

Jump to

Keyboard shortcuts

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