udwIo

package
v0.0.0-...-f254aa5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DiscardReadFrom = ioutil.Discard.(io.ReaderFrom).ReadFrom
View Source
var Nop = tnop{}
View Source
var NopCloser io.Closer = Nop

Functions

func ErrorHandlerNil

func ErrorHandlerNil() error

func FmtByteNum

func FmtByteNum(byteNum int) string

func FmtByteSpeed

func FmtByteSpeed(byteNum int, dur time.Duration) string

func MultiCloser

func MultiCloser(closers ...io.Closer) io.Closer

func MultiErrorHandle

func MultiErrorHandle(fs ...func() error) error

func MustReadAll

func MustReadAll(r io.Reader) (b []byte)

func NewDebugReader

func NewDebugReader(r io.Reader, name string) *debugReader

func NewDebugRwc

func NewDebugRwc(rwc io.ReadWriteCloser, name string) debugRwc

func NewDebugRwcNoData

func NewDebugRwcNoData(rwc io.ReadWriteCloser, name string) debugRwc

func NewDebugWriter

func NewDebugWriter(w io.Writer, name string) *debugWriter

func NewLockWriter

func NewLockWriter(w io.Writer) io.Writer

func NewMultiErrorHandler

func NewMultiErrorHandler(fs ...func() error) func() error

func NewReadAddCloser

func NewReadAddCloser(r io.Reader, closer io.Closer) io.ReadCloser

func NewReaderWithNopCloser

func NewReaderWithNopCloser(r io.Reader) io.ReadCloser

func NewRwcFromReader

func NewRwcFromReader(r io.Reader) io.ReadWriteCloser

func NewSumSizeRwc

func NewSumSizeRwc(rwc io.ReadWriteCloser, name string) io.ReadWriteCloser

func NewWriteAddCloser

func NewWriteAddCloser(w io.Writer, closer io.Closer) io.WriteCloser

func NewWriterWrapToReaderWrap

func NewWriterWrapToReaderWrap(newWriter func(w1 io.Writer) (w2 io.WriteCloser), r1 io.Reader) (r2 io.Reader)

func ReadAll

func ReadAll(r io.Reader) (b []byte, err error)

func TwoWayPipe

func TwoWayPipe() (rwc1 io.ReadWriteCloser, rwc2 io.ReadWriteCloser)

Types

type CallbackReaderWriterCloser

type CallbackReaderWriterCloser struct {
	Reader func(b []byte) (n int, err error)
	Writer func(b []byte) (n int, err error)
	Closer func() (err error)
}

func (CallbackReaderWriterCloser) Close

func (crwc CallbackReaderWriterCloser) Close() (err error)

func (CallbackReaderWriterCloser) Read

func (crwc CallbackReaderWriterCloser) Read(b []byte) (n int, err error)

func (CallbackReaderWriterCloser) Write

func (crwc CallbackReaderWriterCloser) Write(b []byte) (n int, err error)

type CloserFunc

type CloserFunc func() (err error)

func (CloserFunc) Close

func (f CloserFunc) Close() (err error)

type LimitReader

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

func NewLimitReader

func NewLimitReader(r io.Reader, n int64) *LimitReader

func (*LimitReader) IsUnderReaderEof

func (l *LimitReader) IsUnderReaderEof() bool

func (*LimitReader) Read

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

type LockWriter

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

func (*LockWriter) Write

func (w *LockWriter) Write(p []byte) (n int, err error)

type RwcWrapper

type RwcWrapper interface {
	RwcWrap(in io.ReadWriteCloser) (out io.ReadWriteCloser, err error)
}

type RwcWrapperFunc

type RwcWrapperFunc func(in io.ReadWriteCloser) (out io.ReadWriteCloser, err error)

func (RwcWrapperFunc) RwcWrap

func (f RwcWrapperFunc) RwcWrap(in io.ReadWriteCloser) (out io.ReadWriteCloser, err error)

type SingleByteReader

type SingleByteReader interface {
	io.Reader
	io.ByteReader
}

func NewSingleByteReader

func NewSingleByteReader(r io.Reader) SingleByteReader

type StructWriterReaderCloser

type StructWriterReaderCloser struct {
	io.Writer
	io.Reader
	io.Closer
}

Jump to

Keyboard shortcuts

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