Documentation
¶
Index ¶
- func AtEOF(r io.Reader) bool
- func CloseOnce(c io.Closer) io.Closer
- func CloserAfterCallback(c io.Closer, cb func()) io.Closer
- func CloserCallback(c io.Closer, cb func()) io.Closer
- func GetReadCloserLimit(rc io.ReadCloser) (*io.LimitedReader, int64)
- func GetReaderLimit(r io.Reader) (*io.LimitedReader, int64)
- func NopReadCloser(r io.Reader) io.ReadCloser
- func NopWriteCloser(w io.Writer) io.WriteCloser
- func ReadCloser(r io.Reader, c io.Closer) io.ReadCloser
- func UpdateReadCloserLimit(rc io.ReadCloser, limit int64) (io.ReadCloser, *io.LimitedReader, int64)
- func UpdateReaderLimit(r io.Reader, limit int64) (*io.LimitedReader, int64)
- func WriteCloser(w io.Writer, c io.Closer) io.WriteCloser
- type CloserFunc
- type LengthFunc
- type Lengther
- type NopCloser
- type ReadCloserType
- type ReaderFromFunc
- type ReaderFunc
- type Sizer
- type SizerFunc
- type WriterFunc
- type WriterToFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloserAfterCallback ¶
CloserAfterCallback wraps io.Closer to add a callback called just before Close().
func CloserCallback ¶
CloserCallback wraps io.Closer to add a callback deferred to call just after Close().
func GetReadCloserLimit ¶
func GetReadCloserLimit(rc io.ReadCloser) (*io.LimitedReader, int64)
GetReadCloserLimit attempts to unwrap io.ReadCloser to access its io.LimitedReader with limit.
func GetReaderLimit ¶
func GetReaderLimit(r io.Reader) (*io.LimitedReader, int64)
GetReadCloserLimit attempts to cast io.Reader to access its io.LimitedReader with limit.
func NopReadCloser ¶
func NopReadCloser(r io.Reader) io.ReadCloser
NopReadCloser wraps io.Reader with NopCloser{} in ReadCloserType.
func NopWriteCloser ¶
func NopWriteCloser(w io.Writer) io.WriteCloser
NopWriteCloser wraps an io.Writer to implement io.WriteCloser with empty io.Closer implementation.
func ReadCloser ¶
ReadCloser wraps an io.Reader and io.Closer in order to implement io.ReadCloser.
func UpdateReadCloserLimit ¶
func UpdateReadCloserLimit(rc io.ReadCloser, limit int64) (io.ReadCloser, *io.LimitedReader, int64)
UpdateReadCloserLimit attempts to update the limit of a readcloser for existing, newly wrapping if necessary.
func UpdateReaderLimit ¶
UpdateReaderLimit attempts to update the limit of a reader for existing, newly wrapping if necessary.
func WriteCloser ¶
WriteCloser wraps an io.Writer and io.Closer in order to implement io.WriteCloser.
Types ¶
type CloserFunc ¶
type CloserFunc func() error
CloserFunc is a function signature which allows a function to implement the io.Closer type.
func (CloserFunc) Close ¶
func (c CloserFunc) Close() error
type LengthFunc ¶
type LengthFunc func() int
LengthFunc is a function signature which allows a function to implement the Lengther type.
func (LengthFunc) Len ¶
func (l LengthFunc) Len() int
type NopCloser ¶
type NopCloser struct{}
NopCloser is an empty implementation of io.Closer, that simply does nothing!
type ReadCloserType ¶
ReadCloserType implements io.ReadCloser by combining the two underlying interfaces, while providing an exported type to still access the underlying original io.Reader or io.Closer separately (e.g. without wrapping).
type ReaderFromFunc ¶
ReaderFromFunc is a function signature which allows a function to implement the io.ReaderFrom type.
type ReaderFunc ¶
ReaderFunc is a function signature which allows a function to implement the io.Reader type.
type SizerFunc ¶
type SizerFunc func() int64
SizerFunc is a function signature which allows a function to implement the Sizer type.
type WriterFunc ¶
WriterFunc is a function signature which allows a function to implement the io.Writer type.