Documentation ¶
Index ¶
- func LimitOfReader(r io.Reader) int64
- func LimitOfWriter(w io.Writer) int64
- func LimitOfWriterTo(w io.WriterTo) int64
- func NewTeeReader(main io.Reader, copy io.Writer) io.Reader
- func NewTeeReaderWithSkip(main io.Reader, copy io.Writer, skipLeadingBytes int) io.Reader
- func NewTeeWriter(main, copy io.Writer) io.Writer
- func NewTeeWriterWithSkip(main, copy io.Writer, zeroLeadingBytes int) io.Writer
- func RateLimitedBySize(n int64, q RateLimiter) error
- func RateLimitedByteCopy(fn func([]byte) (int, error), p []byte, q RateLimiter) (int, error)
- func RateLimitedCopy(writer io.Writer, reader io.Reader, q RateLimiter) (int64, error)
- func SafeClose(c io.Closer) error
- func SafeCloseChain(c io.Closer, prev error) error
- func SafeCloseWithDefault(c io.Closer, nilErrorFn func() error) error
- func WriteZeros(x int, w io.Writer) (int, error)
- type ErrorWrapper
- type LenReader
- type LimitedReader
- type LimitedTriggerReader
- type LimitedWriter
- type NullReadWriter
- type PrependedReader
- type PrependedWriter
- type RateLimitedReader
- type RateLimitedWriter
- type RateLimiter
- type ReaderFunc
- type TeeReader
- type TeeWriter
- type WriterFunc
- type WriterToFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LimitOfReader ¶
func LimitOfWriter ¶
func LimitOfWriterTo ¶
func NewTeeReaderWithSkip ¶
func NewTeeWriterWithSkip ¶
func RateLimitedBySize ¶
func RateLimitedBySize(n int64, q RateLimiter) error
func RateLimitedByteCopy ¶
func RateLimitedCopy ¶
Types ¶
type ErrorWrapper ¶
type ErrorWrapper struct {
// contains filtered or unexported fields
}
func WrapError ¶
func WrapError(err error) ErrorWrapper
func (ErrorWrapper) Close ¶
func (w ErrorWrapper) Close() error
func (ErrorWrapper) Error ¶
func (w ErrorWrapper) Error() error
func (ErrorWrapper) Len ¶
func (w ErrorWrapper) Len() int
type LimitedReader ¶
type LimitedReader struct {
// contains filtered or unexported fields
}
func LimitReader ¶
func LimitReader(r io.Reader, n int64) *LimitedReader
func NewLimitedTeeReader ¶
func (*LimitedReader) Len ¶
func (l *LimitedReader) Len() int
func (*LimitedReader) RemainingBytes ¶
func (l *LimitedReader) RemainingBytes() int64
type LimitedTriggerReader ¶
type LimitedTriggerReader struct {
// contains filtered or unexported fields
}
func LimitReaderWithTrigger ¶
func LimitReaderWithTrigger(r io.Reader, n int64, triggerFn func(int64)) *LimitedTriggerReader
func (*LimitedTriggerReader) Close ¶
func (p *LimitedTriggerReader) Close() error
type LimitedWriter ¶
type LimitedWriter struct {
// contains filtered or unexported fields
}
func LimitWriter ¶
func LimitWriter(w io.Writer, n int64) *LimitedWriter
func NewLimitedTeeWriter ¶
func NewLimitedTeeWriter(main, copy io.Writer, limit int64) *LimitedWriter
func NewLimitedTeeWriterWithSkip ¶
func NewLimitedTeeWriterWithSkip(main, copy io.Writer, skipLeadingBytes int, limit int64) *LimitedWriter
func (*LimitedWriter) RemainingBytes ¶
func (l *LimitedWriter) RemainingBytes() int64
type PrependedReader ¶
func PrependReader ¶
func PrependReader(b []byte, r io.Reader) *PrependedReader
type PrependedWriter ¶
func PrependWriter ¶
func PrependWriter(b []byte, w io.Writer) *PrependedWriter
func (*PrependedWriter) Close ¶
func (p *PrependedWriter) Close() error
func (*PrependedWriter) Flush ¶
func (p *PrependedWriter) Flush() error
type RateLimitedReader ¶
type RateLimitedReader struct { R io.Reader Q RateLimiter }
func RateLimitReader ¶
func RateLimitReader(r io.Reader, q RateLimiter) *RateLimitedReader
func (RateLimitedReader) Close ¶
func (r RateLimitedReader) Close() error
type RateLimitedWriter ¶
type RateLimitedWriter struct { W io.Writer Q RateLimiter }
func RateLimitWriter ¶
func RateLimitWriter(w io.Writer, q RateLimiter) *RateLimitedWriter
func (RateLimitedWriter) Close ¶
func (r RateLimitedWriter) Close() error
type RateLimiter ¶
type ReaderFunc ¶
type WriterFunc ¶
Click to show internal directories.
Click to hide internal directories.