Documentation ¶
Index ¶
- Variables
- func ErrorHandlerNil() error
- func FmtByteNum(byteNum int) string
- func FmtByteSpeed(byteNum int, dur time.Duration) string
- func MultiCloser(closers ...io.Closer) io.Closer
- func MultiErrorHandle(fs ...func() error) error
- func MustReadAll(r io.Reader) (b []byte)
- func NewDebugRwc(rwc io.ReadWriteCloser, name string) debugRwc
- func NewDebugRwcNoData(rwc io.ReadWriteCloser, name string) debugRwc
- func NewMultiErrorHandler(fs ...func() error) func() error
- func NewSumSizeRwc(rwc io.ReadWriteCloser, name string) io.ReadWriteCloser
- func TwoWayPipe() (rwc1 io.ReadWriteCloser, rwc2 io.ReadWriteCloser)
- type CloserFunc
- type RwcWrapper
- type RwcWrapperFunc
- type SingleByteReader
- type StructWriterReaderCloser
Constants ¶
This section is empty.
Variables ¶
View Source
var DiscardReadFrom = ioutil.Discard.(io.ReaderFrom).ReadFrom
将所有内容都读出来,但是将结果全部扔掉,只返回读取的字节数量
View Source
var NopCloser io.Closer = nopCloser{}
Functions ¶
func ErrorHandlerNil ¶
func ErrorHandlerNil() error
func FmtByteNum ¶
func MultiErrorHandle ¶
func MustReadAll ¶
func NewDebugRwc ¶
func NewDebugRwc(rwc io.ReadWriteCloser, name string) debugRwc
func NewDebugRwcNoData ¶
func NewDebugRwcNoData(rwc io.ReadWriteCloser, name string) debugRwc
func NewMultiErrorHandler ¶
func NewSumSizeRwc ¶
func NewSumSizeRwc(rwc io.ReadWriteCloser, name string) io.ReadWriteCloser
func TwoWayPipe ¶
func TwoWayPipe() (rwc1 io.ReadWriteCloser, rwc2 io.ReadWriteCloser)
Types ¶
type CloserFunc ¶
type CloserFunc func() (err error)
func (CloserFunc) Close ¶
func (f CloserFunc) Close() (err error)
type RwcWrapper ¶
type RwcWrapper interface {
RwcWrap(in io.ReadWriteCloser) (out io.ReadWriteCloser, err error)
}
把一个rwc转换成另一个rwc
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
Click to show internal directories.
Click to hide internal directories.