cio

package
v0.0.0-...-36fb464 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggingPipe

func LoggingPipe(src io.ReadWriteCloser, dst io.ReadWriteCloser) (int64, int64)

func Pipe

func Pipe(src io.ReadWriteCloser, dst io.ReadWriteCloser) (int64, int64)

func PipeWithTee

func PipeWithTee(src io.ReadWriteCloser, dst io.ReadWriteCloser, srcToDstTap io.Writer, dstToSrcTap io.Writer) (int64, int64)

PipeWithTee copies bytes bidirectionally between src and dst like Pipe, but allows tapping into each direction by providing optional writers. srcToDstTap receives a copy of bytes flowing from src -> dst. dstToSrcTap receives a copy of bytes flowing from dst -> src. Taps are best-effort and should be non-blocking; if tap Write blocks or fails, the copy continues regardless.

Types

type Logger

type Logger struct {
	Info, Debug bool
	// contains filtered or unexported fields
}

Logger is pkg/log Logger with prefixing and 2 log levels

func NewLogger

func NewLogger(prefix string) *Logger

func NewLoggerFlag

func NewLoggerFlag(prefix string, flag int) *Logger

func (*Logger) Debugf

func (l *Logger) Debugf(f string, args ...interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(f string, args ...interface{}) error

func (*Logger) Fork

func (l *Logger) Fork(prefix string, args ...interface{}) *Logger

func (*Logger) Infof

func (l *Logger) Infof(f string, args ...interface{})

func (*Logger) IsDebug

func (l *Logger) IsDebug() bool

func (*Logger) IsInfo

func (l *Logger) IsInfo() bool

func (*Logger) Prefix

func (l *Logger) Prefix() string

type LoggingReadWriteCloser

type LoggingReadWriteCloser struct {
	// contains filtered or unexported fields
}

func NewLoggingReadWriteCloser

func NewLoggingReadWriteCloser(rw io.ReadWriteCloser, logger *Logger, prefix string) *LoggingReadWriteCloser

func (*LoggingReadWriteCloser) Close

func (l *LoggingReadWriteCloser) Close() error

func (*LoggingReadWriteCloser) Read

func (l *LoggingReadWriteCloser) Read(p []byte) (n int, err error)

func (*LoggingReadWriteCloser) Write

func (l *LoggingReadWriteCloser) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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