Documentation ¶
Index ¶
- func ReadFnCloser(r io.Reader, close func() error) io.ReadCloser
- func StreamReadFunc(read func(io.Reader) error) io.Writer
- func StreamWriteFunc(write func(io.Writer) error) io.Reader
- func TempFileSeeker(r io.Reader) (io.ReadSeekCloser, error)
- func WriteFnCloser(w io.Writer, close func() error) io.WriteCloser
- type SilentReader
- type SilentWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadFnCloser ¶
func ReadFnCloser(r io.Reader, close func() error) io.ReadCloser
ReadFnCloser takes an io.Reader and wraps it to use the provided function to implement io.Closer.
func TempFileSeeker ¶
func TempFileSeeker(r io.Reader) (io.ReadSeekCloser, error)
TempFileSeeker converts the provided Reader into a ReadSeekCloser by using an underlying temporary file. Callers should call the Close function when they're done with the TempFileSeeker, to release + clean up the temporary file.
func WriteFnCloser ¶
func WriteFnCloser(w io.Writer, close func() error) io.WriteCloser
WriteFnCloser takes an io.Writer and wraps it to use the provided function to implement io.Closer.
Types ¶
type SilentReader ¶
SilentReader wraps an io.Reader to silence any error output during reads. Instead they are stored and accessible (not concurrency safe!) via .Error().
func SilenceReader ¶
func SilenceReader(r io.Reader) *SilentReader
SilenceReader wraps an io.Reader within SilentReader{}.
func (*SilentReader) Error ¶
func (r *SilentReader) Error() error
type SilentWriter ¶
SilentWriter wraps an io.Writer to silence any error output during writes. Instead they are stored and accessible (not concurrency safe!) via .Error().
func SilenceWriter ¶
func SilenceWriter(w io.Writer) *SilentWriter
SilenceWriter wraps an io.Writer within SilentWriter{}.
func (*SilentWriter) Error ¶
func (w *SilentWriter) Error() error