Documentation ¶
Overview ¶
Package iohelper should brings tools to help manage IOs
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrClosed = errors.New("closed")
ErrClosed is returned if the buffer was closed
Functions ¶
This section is empty.
Types ¶
type AsyncWriterBuffer ¶
type AsyncWriterBuffer struct {
// contains filtered or unexported fields
}
AsyncWriterBuffer is an asynchronous writer that will push writes to a buffer and then writes them in separate goroutine.
func NewAsyncWriterBuffer ¶
func NewAsyncWriterBuffer(writer io.WriteCloser, maxSize int) *AsyncWriterBuffer
NewAsyncWriterBuffer creates a new asynchronous buffered writer based on a standard buffer
func (*AsyncWriterBuffer) Close ¶
func (aw *AsyncWriterBuffer) Close() error
Close flushes the buffer and closes the underlying writer
type AsyncWriterChannel ¶
type AsyncWriterChannel struct {
// contains filtered or unexported fields
}
AsyncWriterChannel is an asynchronous writer that will push writes to a channel and then write them in a separate goroutine.
func NewAsyncWriterChannel ¶
func NewAsyncWriterChannel(writer io.WriteCloser, bufferSize int) *AsyncWriterChannel
NewAsyncWriterChannel creates an asynchronous buffered writer based on a channel
func (*AsyncWriterChannel) Close ¶
func (aw *AsyncWriterChannel) Close() error
Close flushes the buffer and closes the underlying writer
type BufferedWriteCloser ¶
BufferedWriteCloser brings a io.Closer to the bufio.Writer
func NewBufferedWriteCloser ¶
func NewBufferedWriteCloser(dst io.WriteCloser, size int) *BufferedWriteCloser
NewBufferedWriteCloser will create a buffered WriteCloser instance from a WriteCloser
func (*BufferedWriteCloser) Close ¶
func (wc *BufferedWriteCloser) Close() error
Close will close the underlying stream