Versions in this module Expand all Collapse all v1 v1.13.1 Mar 11, 2020 Changes in this version + var ErrClosed = errors.New("write to closed BytesPipe") + func AtomicWriteFile(filename string, data []byte, perm os.FileMode) error + func FprintfIfNotEmpty(w io.Writer, format, value string) (int, error) + func FprintfIfTrue(w io.Writer, format string, ok bool) (int, error) + func HashData(src io.Reader) (string, error) + func MultiReadSeeker(readers ...io.ReadSeeker) io.ReadSeeker + func NewAtomicFileWriter(filename string, perm os.FileMode) (io.WriteCloser, error) + func NewCancelReadCloser(ctx context.Context, in io.ReadCloser) io.ReadCloser + func NewReadCloserWrapper(r io.Reader, closer func() error) io.ReadCloser + func NewReaderErrWrapper(r io.Reader, closer func()) io.Reader + func NewWriteCloserWrapper(r io.Writer, closer func() error) io.WriteCloser + func NopWriteCloser(w io.Writer) io.WriteCloser + func TempDir(dir, prefix string) (string, error) + type AtomicWriteSet struct + func NewAtomicWriteSet(tmpDir string) (*AtomicWriteSet, error) + func (ws *AtomicWriteSet) Cancel() error + func (ws *AtomicWriteSet) Commit(target string) error + func (ws *AtomicWriteSet) FileWriter(name string, flag int, perm os.FileMode) (io.WriteCloser, error) + func (ws *AtomicWriteSet) String() string + func (ws *AtomicWriteSet) WriteFile(filename string, data []byte, perm os.FileMode) error + type BytesPipe struct + func NewBytesPipe() *BytesPipe + func (bp *BytesPipe) Close() error + func (bp *BytesPipe) CloseWithError(err error) error + func (bp *BytesPipe) Read(p []byte) (n int, err error) + func (bp *BytesPipe) Write(p []byte) (int, error) + type NopFlusher struct + func (f *NopFlusher) Flush() + type NopWriter struct + func (*NopWriter) Write(buf []byte) (int, error) + type OnEOFReader struct + Fn func() + Rc io.ReadCloser + func (r *OnEOFReader) Close() error + func (r *OnEOFReader) Read(p []byte) (n int, err error) + type WriteCounter struct + Count int64 + Writer io.Writer + func NewWriteCounter(w io.Writer) *WriteCounter + func (wc *WriteCounter) Write(p []byte) (count int, err error) + type WriteFlusher struct + func NewWriteFlusher(w io.Writer) *WriteFlusher + func (wf *WriteFlusher) Close() error + func (wf *WriteFlusher) Flush() + func (wf *WriteFlusher) Flushed() bool + func (wf *WriteFlusher) Write(b []byte) (n int, err error)